Link to home
Start Free TrialLog in
Avatar of DaveChoiceTech
DaveChoiceTech

asked on

Linked Pages in ASP.NET with persistant data

I want to design an ASP.NET application with 3 forms. Each of the forms is related to each other as follows,
1. Search Criteria Form - user fill out fields to restrict a database query eg. date range, transaction # etc.
2. History Form - displays records in a grid view that match criteria from Search Criteria Form
3. Transaction Details Form - shows individual transaction selected from the history forms GridView

The behaviour between these related forms should be
1. Initial Form is Search Criteria Form - user fills out fields - creates sql query
2. Submit event from Search Criteria Form brings up History Form with records matching sql query
then,
    2a. Cancel Button - returns to Initial Form with user filled out fields retained from original submission
   or
   2b. Transaction Details Form loaded by selecting a row in the GridView
3. Cancel Button on Transaction Details  Form returns to Search Criteria Form while retaining the already set sql query

My question is how to make the form display and data persist as the user navigates between the forms as described above.  My thinking so far is that I could use either hidden fields or session variables. I am new to ASP so there may be even better options.

Any and all advies would be appreciated.

Thanks,

Dave


ASKER CERTIFIED SOLUTION
Avatar of samtran0331
samtran0331
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DaveChoiceTech
DaveChoiceTech

ASKER

samtran0331

Thanks for the info re viewstate info and server transfer. The 3'rd form is the transfer details form. It takes up almost the entire screen using tables to place controls etc. Is this practical with a detail view?
Also, how can I keep the values in the first form when I return to it from the S'cd form?
 

>>It takes up almost the entire screen using tables to place controls etc. Is this practical with a detail view?

You don't necessarily have to show the grid when the DetailsView is visible. You can hide the Gridview when the DetailsView is visible and vice versa.

>>Also, how can I keep the values in the first form when I return to it from the S'cd form?

Well, if you have a button that has a javascript:history.go(-1);
wired to it, then it will pull the page from the browser cache which would include the textbox/search criteria.
If you want to manually control it and make sure the values go back, then I guess I would use Session variables.

The main reason I like to use querystring variables for search pages, is that you'll notice most major search engines do this...and it gives you the option of loading the second page from a link...
like if you wired up form 2 (let's call it history.aspx) to catch querystring variables, then you could bookmark search criteria or send the link in the email with something like:
http://www.yourdomain.com/history.aspx?val1=somevalue&val2=somethingelse
which would allow you to bypass the search page altogether as long as you send history.aspx the correct variables...
i would suggest that you can build all of this in a single page .. the top section of the page is the search section with the submit button .. down below you can have a grid which is editable .. with editcolumn .. in the click event ot the submit button, do the search and bind the result to the gridview .. now the user has the option to edit each row as he wants .. now there is no need to worry about persistance because it is all in one page and viewstate will manage all of it for you ..

Rejo
sorry samtran .. seems to have repeated some of things you had mentioned above ..