asp.net drop downlist value reset on button click within jquery dialog
I have a div , within which I have a button and an asp.net dropdownlist. I
can change the value in the dropdownlist . But as soon as the button is
clicked the value in the drop down list is again set to the default
initial value. Is there a way I can solve this problem ? I do not want the
dropdownlist to go back to its initial value.
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" >
<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);
}
}
No comments:
Post a Comment