my requirement is
when i click on lbkbtn i need to show a modal popup In that modal popup i have a dropdown and a textbox i need to bind
datafield value of settlementcycle to the dropdown that was inside my modal ddlcycle
and perlimit transaction field value to the txtTperlimit inside that modal i am unable to do it can u pls fix me out this issue..
My Gridview
Code
" PageButtonCount="4" />
' runat="server" class="fa fa-pencil" OnClick="lnkbtn_Click">Code Behind
C#
protected void lnkbtn_Click(object sender, EventArgs e)
{
try
{
LinkButton lnkbtn = sender as LinkButton;
GridViewRow row = lnkbtn.NamingContainer as GridViewRow;
if (row != null)
{
int index = row.RowIndex;
if (index >= 0 && index alert('" + exception.Message.ToString() + "')", true);
}
catch (Exception ex)
{
oExceptionManager.LogError(ex.Message, " -- In btnEdit_Click Function Settlements.aspx.cs");
throw new Exception();
}
}my Modal
Code
×
Amit MohantyRank #112 · 20K reputationPosted Nov 24, 2023, 2:03 AM EST
Ensure that the necessary JavaScript libraries are included at the top of your page. Try this:
protected void lnkbtn_Click(object sender, EventArgs e) { try { LinkButton linkButton = sender as LinkButton; GridViewRow row = linkButton.NamingContainer as GridViewRow; if (row != null) { int index = row.RowIndex; // Get the data source bound to the GridView DataTable dataSource = (DataTable)GrdVsettleRecords.DataSource; if (index >= 0 && index alert('" + exception.Message.ToString() + "')", true); oExceptionManager.LogError(exception.Message, " -- In btnEdit_Click Function Settlements.aspx.cs"); throw new Exception("Error occurred: " + exception.Message); } }Satyaprakash SamantarayRank #101 · 21.1K reputationPosted Nov 24, 2023, 12:20 AM EST
Hi,
Please check below link related to modal where u can find bind drop-down value and reflect on modal popup as well as for other server controls as well
https://www.c-sharpcorner.com/article/lets-learn-jquery-ajax-and-modal-popup-using-mvc-in-depth/