Showing posts with label visibletrueif. Show all posts
Showing posts with label visibletrueif. Show all posts

Tuesday, March 13, 2012

Switch two gridViews, but put in the same place, how to do it ?

if click_button1, then gridView1.visible=true

if click_button2, then show gridView2.visible=true

but, How to layout them in myFile.aspx ? I want to show them in the same place, switch from one to another ?

Just place them one after the other

<asp:GridViewID="GridView1"runat="server"> ...</asp:GridView><asp:GridViewID="GridView2"runat="server"> ... </asp:GridView>

Then in the button 1 event handler you have:

GridView1.Visible = true;
GridView2.Visible = false;


Mark as ANSWER. Thanks.