ASP.NET下拉jquery的对话框中列表值并没有改变 [英] Asp.net drop down list value doesnt change within jquery dialog

查看:287
本文介绍了ASP.NET下拉jquery的对话框中列表值并没有改变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个div,在其中我有一个按钮和一个asp.net的DropDownList。我看到DropDownList的值并没有改变。 IE浏览器。如果我从DropDownList中选择30,选择的值仍显示为这是默认值15,当我选择1小时,2小时,同样的事情发生48小时等。

I have a div , within which I have a button and an asp.net dropdownlist. I see that the dropdownlist value doesnt change. ie. If I select 30 from the dropdownlist, the selected value is still shown as the default value which is 15, Same thing happens when I select 1Hr , 2Hrs , 48Hrs etc.

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>&nbsp&nbsp&nbsp
           <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的

javascript

function ViewModelPopup2() {
        $("#ViewModalPopupDiv2").dialog({
                scrollable: true,
                width: 800,
                modal: true
            });
        }

aspx.cs

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);
        }
    }

这是我可以做什么有什么建议?

Any Suggestions on what I can do ?

推荐答案

您已经设定的AutoPostBack对下拉列表中。有了这样一套意味着它回发并刷新这导致选择默认值控制。

You have AutoPostBack set against the drop down list. Having that set means it's posting back and refreshing the control which causes the default value to be selected.

这篇关于ASP.NET下拉jquery的对话框中列表值并没有改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆