![]() |
|
|
|
#1 |
|
What would be the correct way to do this:
Page A: ComboBox with values A/B/C Button which redirects to page B. Page B. Button which redirects to Page A. Start page A, combo box has the value A. Now if i change the combo box in page A to the value B. Click on the button which takes my to Page B. Click on the button which takes me back to page A. Then the viewstate for the combo has been reset to the value A. So what are the correct way to handle this persistance ? And what if i need to return values from page B to page A ? Like a flag which indicates if page B has been cancelled. In page A check if page B was cancelled and do different stuff. How is this done ? I know i can send parameters to page B like this asp?id=10 etc. Do i need to do it the same way when sending back to page A ? What i'm actually are going to do is have a datagrid + 4 comboboxes in page A. And a add new record function which will redirect to page B for input of 6 values. Then goback to page B and refresh the dataset if page B was not cancelled. If cancelled then display the same state for the comboboxes and the datagrid as before redirecting to page B. I'm new to this so need some pointers Dst |
|
|
|
|
#2 |
|
Posts: n/a
|
I think the querystring aproach would be the simplest way to go about.
Another aproach would be to use cross-page postbacks, but that would be a bit messy (you would have to keep the values for the comboboxes somewhere in page B, and then re-read them from A). Also, the Session object is an alternative, but I've been taught to stay away from it Vlad Iliescu |
|
|
|
#3 |
|
Posts: n/a
|
Do you absolutively need to have two separate pages?
Why not use either : Option 1 : Code:
Option 2 : Use the ASP:MultiViews <asp:MultiView runat="server" ActiveViewIndex="0"> <asp:View>view one </asp:View> <asp:View>view two</asp:View> </asp:MultiView> <asp:button runat=server onclick="btSwitch_Onclick" text="Switch views"/> Option 3: create two usercontrols, so you can reuse them on several pages Hope that helps! Florian Doyon |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Gridview delete viewstate problem | erfeyut | Software | 0 | 05-27-2009 10:08 AM |
| viewstate MAC failed in asp.net 2.0 while postback the page | azraffarveen | Software | 0 | 05-12-2009 03:24 PM |
| Bizzare ViewState issue (ASP.NET) | dmartu | Software | 0 | 12-04-2008 10:26 AM |
| access viewstate | meera_p9 | Software | 2 | 10-17-2007 12:18 PM |