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 Behind
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 < GrdVsettleRecords.Rows.Count)
{
string settlementCycleValue = GrdVsettleRecords.Rows[index].Cells[4].Text;
string perTransactionLimit = GrdVsettleRecords.Rows[index].Cells[5].Text;
if (settlementCycleValue == "Instant")
{
ddlCycle.SelectedIndex = 0;
}
if (settlementCycleValue == "Manual")
{
ddlCycle.SelectedIndex = 1;
}
txtTPerLinit.Text = perTransactionLimit;
ScriptManager.RegisterStartupScript(UPDP_Settlements, UPDP_Settlements.GetType(), "ShowEditModal", "ShowEditModal();", true);
}
}
}
catch (Exception exception)
{
ScriptManager.RegisterStartupScript(UPDP_Settlements, UPDP_Settlements.GetType(), "ErrorMsg", "", true);
}
catch (Exception ex)
{
oExceptionManager.LogError(ex.Message, " -- In btnEdit_Click Function Settlements.aspx.cs");
throw new Exception();
}
}
my Modal
Amit MohantyPosted Nov 24, 2023, 7:03 AM
Ensure that the necessary JavaScript libraries are included at the top of your page. Try this:
Satyaprakash SamantarayPosted Nov 24, 2023, 5:20 AM
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/