Another Newbie Question

  • Thread starter Thread starter Yosh
  • Start date Start date
Y

Yosh

What's the recommended method of passing a parameter from one web form to
another?

Thanks,

Yosh
 
Yosh said:
What's the recommended method of passing a parameter from one web form to
another?

Thanks,

Yosh

I prefer using the querystring if the parameter isn't sensitive. If it is,
then either store it in a database along with the sessionid (?) or store it
in the Session... Just some ways to do it :)

HTH,

Mythran
 
What's the recommended method of passing a parameter from one web form to

It all depends on who's doing the recommending. I recommend knowing all of
the methods, and knowing the differences between them, and making an
informed decision about which tool is right for the job at any given point.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
 
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items("myParameter") = x
Server.Transfer("WebForm2.aspx")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.Items("myParameter"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetbips.com/displayarticle.aspx?id=79
 
Back
Top