C# asp.net在jquery对话框中单击按钮时删除下行列表值重置
我有一个div,其中有一个按钮和一个asp.net下拉列表。我可以更改dropdownlist中的值。但单击按钮后,下拉列表中的值将再次设置为默认初始值。有办法解决这个问题吗?我不希望dropdownlist返回其初始值 aspx ASPX.CSC# asp.net在jquery对话框中单击按钮时删除下行列表值重置,c#,javascript,jquery,asp.net,C#,Javascript,Jquery,Asp.net,我有一个div,其中有一个按钮和一个asp.net下拉列表。我可以更改dropdownlist中的值。但单击按钮后,下拉列表中的值将再次设置为默认初始值。有办法解决这个问题吗?我不希望dropdownlist返回其初始值 aspx ASPX.CS protected void btnSendAlertEmail_Click(object sender, EventArgs e) { // Code to send email } pr
protected void btnSendAlertEmail_Click(object sender, EventArgs e)
{
// Code to send email
}
protected void btnConfigureAlerts_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript
(this, this.GetType(), "callScriptFunction", "ViewModelPopup2();", true);
}
}
我看到的问题是,JQuery和更新面板。这两者永远不能正常工作。您需要删除其中一个。但是有一个解决办法。查看这一个。您能显示设置下拉列表值的服务器端代码吗?重复?嘿,斯坦利,这个问题不同。在这里,下拉列表的值发生了变化,但只要单击按钮,下拉列表就会返回到初始值。例如,如果我将x作为初始值,并将值更改为y。我一单击按钮,该值就会返回到xHey Irfan!我在aspx文件本身中有不同的下拉值。服务器端没有特殊的代码来设置值。
function ViewModelPopup2() {
$("#ViewModalPopupDiv2").dialog({
scrollable: true,
width: 800,
modal: true
});
}
protected void btnSendAlertEmail_Click(object sender, EventArgs e)
{
// Code to send email
}
protected void btnConfigureAlerts_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript
(this, this.GetType(), "callScriptFunction", "ViewModelPopup2();", true);
}
}