Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my problem ,, two update pane and one of them had timer , the second had dropdown list and other controls when i choose from dropdownlist , it affect with timer !! and drop down close ..
how to stop effect of dropdown ??

my code ?

XML
<h2>
    Welcome to ASP.NET!
</h2>
<p>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
</p>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Timer1" />
    </Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
        <br />
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
            onselectedindexchanged="DropDownList1_SelectedIndexChanged">
            <asp:ListItem Value="0">jerusalem Capital</asp:ListItem>
            <asp:ListItem Value="1">Haifa</asp:ListItem>
            <asp:ListItem Value="2">Jaffa</asp:ListItem>
            <asp:ListItem Value="3">Gaza</asp:ListItem>
        </asp:DropDownList>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="2000" ontick="Timer1_Tick">
</asp:Timer>
Posted
Comments
Hemant Singh Rautela 29-Apr-13 10:53am    
I think you cant use another controls with timer, because due to timer control(it execute every) the portion of update panel reset... so that dropdownlist effect not occre

1 solution

Default updatemode is always for second updatepanel and as a result UpdatePanel control's content is updated on every postback that originates from anywhere on the page.Change the updatemode property of second panel accordingly..have a look at http://msdn.microsoft.com/en-CA/library/system.web.ui.updatepanel.updatemode.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900