Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi every body

i use master and have an update panel, inside the update panel
i placed lot of panel.

now i want to show the panel ., please give me a solutuion.,
XML
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
    <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="1">



XML
<asp:TabPanel ID="tab3" runat="server" HeaderText="3.Give Traveller Name(s)">
<ContentTemplate>
<table>
<tr>
<td>
<asp:Panel ID="Panel1" runat="server"> // want to show this panel
<asp:Label ID="Label5" runat="server">Adult1</asp:Label>
<asp:DropDownList ID="ddl" runat="server">
<asp:ListItem>thiri</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</asp:Panel>
Posted

nside the update panel i placed lot of panel.
now i want to show the panel ., please give me a solutuion.,
Panel is a server side control that can be accessed directly on server side using it's ID.

Thus for:
ASP.NET
<asp:Panel ID="Panel1" runat="server"> 

Do:
C#
Panel1.Visible = true; // to show panel
Panel1.Visible = false; // to hide panel


To add on - it does not matter if it is in or out of Update Panel. Update panel is just a region defined for partial update if needed.
 
Share this answer
 
Comments
thirisangu 9-May-12 5:11am    
oh.. i didnt expect this answer., not at all...
Sandeep Mewara 9-May-12 5:59am    
So, what were you expecting?
thirisangu 10-May-12 0:13am    
ok, In my first page i have a dropdown contains numbers from 1 to 5.
if i select any value from that drop down, based on the value the panel
should display in second page.
if i select i one means, first panel should display. vice versa.

Panel:
I have kept two panel inside in Update Panel. Within the panel
i have a dropdown and two text boxes.

Panel panel = (Panel)TabContainer1.FindControl("tab3").FindControl("P" + i.ToString());

string rt= panel.ID;

// i tried this one to get the panel id. i got.t but i want to show the
corresponding panel.
if i put rt.visible=true; // it is an error.
i tried to convert into Panel// also an error.

what to do?
Sandeep Mewara 10-May-12 0:56am    
Your actual question and posted question were far apart!
thirisangu 10-May-12 6:15am    
ok anyway., i got that., happy coding.,
TabContainer1.FindControl("tab3").FindControl("P" + i.ToString()).Visible = true;
 
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