Toggle Visibility Of Multiple Content Chunks / Panes / Panels In ASP.NET Page

Dawnfroggie

New Member
I have an C# ASP.NET page (.aspx) which has two primary content regions: (1) a form with text fields (new Item) and (2) a grid control (list of Items). Very simply, the user can fill in the form to create a new Item, and they can see a list of Items to View/Edit/Delete. They click View and the page posts back to fill the form with Item data.Currently they are both visible and are stacked (1) on top of (2). I would like to split this into two distinct panels, whose visibility can be toggled via a button or css tab etc.When panel_1 is showing, panel_2 should not be (and vice-versa). Obviously I can achieve this easily directly with JavaScript (e.g. jQuery click event binding to a button or anchors etc.), but then it may get messy binding the grid control buttons events (View/Edit/Delete) to show the correct panel - i.e. fill in the form >> click Add Item >> show Item List panel (for example). I imagine I could pop some state params into the URL on post back and then bind that data to some local variables in order to know which panel should be showing, but I'm sure there is a better way.In the future I may want to have 3/4/5 related content panels to toggle through, whether that's one form split over multiple panels, or one form and three different ways to display the data (list / graph / etc.).Is there a clean ASP.NET (3.5) way to do this (i.e. wrap each content block in a control and maintain tight grip on UI)?Thanks.
 
Back
Top