Passing Data Around in ASP.NET

G

Glenn

I am an old ASP developer that has begun porting existing apps to ASP.NET.

I am currently working on a wizard dialog that contains about 4 pages. In
ASP in order to keep track of user entered data on the various wizard pages
I had to manually create hidden form fields and pass these between pages.
The form action either went to the next or previous page in the dialog,
depending on whether NEXT or BACK button was pressed. All validation was
done in client side script.

Should I emply the same techniques in ASP.NET, or is there a more efficient
way.

My initial thoughts were to write a custom class capable of storing the
wizard dialog info and instantiate it as session var. Whenever a dialog
button is clicked I will update this structure via a postback server event,
and then move onto the next/prev page using the Response.Redirect or
Response.Transfer.

Am I on the right track?

Thanks,

G.
 
C

Craig Deelsnyder

Glenn said:
I am an old ASP developer that has begun porting existing apps to ASP.NET.

I am currently working on a wizard dialog that contains about 4 pages. In
ASP in order to keep track of user entered data on the various wizard pages
I had to manually create hidden form fields and pass these between pages.
The form action either went to the next or previous page in the dialog,
depending on whether NEXT or BACK button was pressed. All validation was
done in client side script.

Should I emply the same techniques in ASP.NET, or is there a more efficient
way.

My initial thoughts were to write a custom class capable of storing the
wizard dialog info and instantiate it as session var. Whenever a dialog
button is clicked I will update this structure via a postback server event,
and then move onto the next/prev page using the Response.Redirect or
Response.Transfer.

Am I on the right track?

Thanks,

G.

Sounds like a good initial approach, a little more OO than your previous
ASP approach so a little cleaner. Another way I always try to see if it
will work initially, is to use one page with multiple panels, as panels
seem intuitively to lend themselves to this app beautifully (turn one
panel on, then after they enter, turn on the next, etc.). The only
problem is the size of ViewState. If the panels are complex or contain
a number of fields, the ViewState can get to be too much. But you could
also play with selectively enabling ViewState.

Then you don't have to pass anything from page to page....

So if this wouldn't cause ViewState problems, I'd look at using Panels.
Otherwise your approach seems to be just fine...
 
M

MSFT

Hi Glenn,

Thank you for using MSDN Newsgroup. I am Luke and I am review this issue
currently. As I understand, your ASP.NET application is like Wizard which
need to keed data between pages. I think your initial thought about session
is the most common way can use. Besides this, we also can use Application
variant, Viewstate, cookies and hidden fields. If the data shared between
pages are not large, session varaint should be the most easiest way to
achieve.


Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top