Saturday, March 24, 2012

Dropdownlist in Update Panel

Hello everyone,

can you please tell me how to read or set SelectedValue property of a dropdownlist which is located inside a update panel? I can reference it with no problems but all I get is an empty string. Assigning a value doesn't do anything.

Thanks,
Radoslav

The same way you do when you have no UpdatePanel.

Post your code and let us see what you are doing wrong in !


It is same ,when u use it normally.

No extra code, just you have to declare the DropDownList inside the UpdatePanel


Can you provide some code details ...So it will be helpful.

<asp:ScriptManager ID="sm1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel 1" UpdateMode="Conditional" runat="server">
<ContentTemplate>

<asp:DropDownList ID="itemNumber" runat="server" OnSelectedIndexChanged="itemNumber_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
</asp:DropDownList>

</ContentTemplate>
</asp:UpdatePanel>


Hope it will help youSmile

No comments:

Post a Comment