html - Asp.net controls in Div tag are not visible when Div tag is visible? -


i'm trying show/hide div tag (which contains other asp.net controls) on radiobuttonlist onselectedindexchanged event.

issue: when show div tag, controls in div tag not visible. see code below

.aspx page

<asp:radiobuttonlist id="rbltesting" runat="server" autopostback="true" onselectedindexchanged="rbltesting_selectedindexchanged">     <asp:listitem text="show" selected="true" value="0"></asp:listitem>     <asp:listitem text="hide" value="1"></asp:listitem> </asp:radiobuttonlist> <div id="divname" runat="server">     <asp:label id="lblfirstname" runat="server" text="james"></asp:label>     <asp:label id="lbllastname" runat="server" text="anderson"></asp:label> </div> 

.aspx.cs

    protected sub rbltesting_selectedindexchanged(byval sender object, byval e eventargs)         if rbltesting.selectedindex = 0             divname.visible = true             'lblfirstname , lbllastname labels not visible?         else             divname.visible = false         end if     end sub 

i can show/hide individual controls in div on selected index changed event. but, question why controls not visible when div visible.

the c# code is

rbltesting.visible = false; rbltesting.visible = true; 

the 1st section id name of html tag or asp.net control. if using html tag have add attribute runat="server" html tag


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -