Q
Problem solve Get help with specific problems with your technologies, process and projects.

Passing data among four registration pages

I have an application with four registration pages. I am not sure how to pass data back and forth. Please advise.
There are a couple options for doing this, and they will depend on the storage location as well as its "longevity." First, you can use the "old" cookies mechanism. That is, on one page you store cookies, then perform a Response.Redirect, and pick those values back in the next. Second, you can use the Session to store those values. This consumes server resources, however, that last for the whole user session unless you explicitly clear them. Third, my favorite one, is to store those values in the HttpContext.Current.Items collection, and perform a Server.Transfer to the next page. HttpContext.Items stores what I call Transient State, which only lives during a single request, therefore, doesn't consume server resources after the request has been served. This is the store used by built-in features such as Forms Authentication, so you can be pretty confident that it's not a "hack" but a powerful feature. Beware, however, that you can't do a Response.Redirect, because it involves a return to the client, and a client-side redirect, which makes for a completely different Request, therefore, the context is lost.

Dig Deeper on C# programming language

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchCloudComputing

SearchSoftwareQuality

TheServerSide.com

SearchCloudApplications

Close