开发者

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

开发者 https://www.devze.com 2022-12-17 18:57 出处:网络
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 di开发者_JAVA百科splay in the second page)

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 di开发者_JAVA百科splay 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.


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


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...


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

0

精彩评论

暂无评论...
验证码 换一张
取 消