开发者

ASP.NET Cross Page Posting via HttpRequest || Page.PreviousPage?

开发者 https://www.devze.com 2023-02-20 04:06 出处:网络
I\'ve been developing classic ASP pages at the job for the past five years and now we are moving to ASP.NET. I\'m trying to understand how to get form field values from one page to another and it seem

I've been developing classic ASP pages at the job for the past five years and now we are moving to ASP.NET. I'm trying to understand how to get form field values from one page to another and it seems like there is more than one way to do it. In classic ASPI just called request.form collecti开发者_JS百科on and got the information. Which way is recommended in .net? Cross Page, Transfer, or HttpRequest?

Gracias.


It actually depends because I don't always use any particular method. Sometime it is easy to expose as property or sometimes just server.tranfer is fine or sometimes as querystring.

If data is sensitive and/or to many itmes I use Session where you can store an class object of custom type as well and not just basic data type.

And in certain cases I store stuff in DB and just pass an id to the record to next page via querystring or session and retrieve everything I want from DB.

Here is reference to different types available.

0

精彩评论

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