Asp.net 下拉列表值在 jquery 对话框中不会更改
Asp.net drop down list value doesnt change within jquery dialog
我有一个div,里面我有一个按钮和一个 asp.net 下拉列表。我看到下拉列表值没有改变。即。如果我从下拉列表中选择 30,所选值仍显示为默认值 15,当我选择 1 小时、2 小时、48 小时等时也会发生同样的事情。
.aspx
<div id='one'>
<asp:LinkButton ID="ConfigureAlerts" OnClick="btnConfigureAlerts_Click" runat="server">Configure Alerts</asp:LinkButton>
</div>
<div id="ViewModalPopupDiv2">
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:Panel ID="Panel2" runat="server" HorizontalAlign="left" ScrollBars="Auto">
<asp:Button ID="btnGetLogs" runat="server" Text="SendAlerts" OnClick="btnSendAlertEmail_Click"/>
<asp:Label ID="Label2" runat="server" Text="Set The Alert Email Interval to every :" CssClass="label"
ForeColor="Black"></asp:Label>   
<asp:DropDownList ID="ddlTimeInterval" runat="server" AutoPostBack="true" UseSubmitBehavior="false" >
<asp:ListItem Text="15MIN" Value="15"></asp:ListItem>
<asp:ListItem Text="30MIN" Value="30"></asp:ListItem>
<asp:ListItem Text="1Hr" Value="60"></asp:ListItem>
<asp:ListItem Text="2Hrs" Value="120"></asp:ListItem>
<asp:ListItem Text="8Hrs" Value="480"></asp:ListItem>
<asp:ListItem Text="24Hrs" Value="1440"></asp:ListItem>
<asp:ListItem Text="48Hrs" Value="2880"></asp:ListItem>
</asp:DropDownList>
<br />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
JavaScript
function ViewModelPopup2() {
$("#ViewModalPopupDiv2").dialog({
scrollable: true,
width: 800,
modal: true
});
}
aspx.cs
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);
}
}
关于我能做什么的任何建议?
您已经针对下拉列表设置了自动回发。设置该组意味着它正在回发并刷新导致选择默认值的控件。
<asp:button Id=" btnConfigureAlerts" runat="Server" OnClientClick="ViewModelPopup2()"></asp:button>
function ViewModelPopup2() {
$("#ViewModalPopupDiv2").dialog({
scrollable: true,
width: 800,
modal: true
});
};
相关文章:
- 使用jquery对话框中的箭头键
- 获取打开jquery对话框的button的id
- 我怎么能让jQuery对话框表现得像Javascript警报
- 如何在页面重新加载时显示jquery ui对话框
- 如何为javascript方法放入jquery确认对话框
- Jquery UI对话框不会消失
- jQuery UI对话框错误,按钮导致HierarchyRequestError
- 如何在jquery中检测浏览器的后退按钮,如果有任何对话框打开,请关闭它
- 获取活动的jQuery UI对话框
- 使用模态对话框(JQuery)编辑函数
- 无法在其他调用上设置jQuery对话框选项
- jQuery UI模式对话框覆盖淡出
- 如何在jQuery对话框标题栏中添加额外的按钮
- 从jquery对话框恢复原始数据,脚本不起作用
- jQuery模态弹出的行为类似于确认和警报对话框
- 单击按钮创建多实例jQuery UI对话框
- JQuery UI对话框在重新打开时未正确调整大小
- Jquery对话框('打开')不工作
- 保存对话框jquery
- 打开覆盖(模态对话框)jquery工具在页面加载