Tangiest
Tangiest

Reputation: 44597

Alternative to Query Strings to Pass Data Between ASP.Net Pages?

I am currently using a number of query string parameters to pass some data from one page to a second page (the parameters hold confirmation/error messages to display in the second page), that due to a third party product can no longer work correctly in the production environment. The user completes an action on the first page, and is then transferred to the second page. What are the possible alternatives to use instead of a query string and GET - session variables, POST data, or something completely different?

Thanks, MagicAndi.

Upvotes: 3

Views: 6957

Answers (3)

Hiyasat
Hiyasat

Reputation: 8926

you can use this if you use window.open("openTheotherPage",...etc)

so form the opened page you can do something like this

var valuefromCallerPage = window.opener.document.FormNmae.textbox.value

or button or anything on the caller page

Upvotes: 0

Jace Rhea
Jace Rhea

Reputation: 5018

You could create public properties in a source page and access the property values in the target page when using a server transfer. You could also get control information in the target page from controls in the source page by referencing the Page.PreviousPage property.

Both of these methods are oulined here: http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx

Upvotes: 5

Klaus Byskov Pedersen
Klaus Byskov Pedersen

Reputation: 120917

Both POST data and session variables would work just fine. POST data has the drawback that it can be changed by the client and session variables take up memory, so you can choose based on that. I personally don't think that you should pass such messages to the client for the reason stated above but I guess you are already doing that, so...

Upvotes: 4

Related Questions