passing parameter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

need to passing parameter from 1st page to 2nd page...

try to use
public static void user_param(string namaku ,string umurku ) but still
cannot why??

please help...
 
Khamal said:
need to passing parameter from 1st page to 2nd page...

try to use
public static void user_param(string namaku ,string umurku ) but still
cannot why??

please help...

You can't transfer values via parameters, because that second page
is (probably) called in a separate request. Then it would be a different
instance, so any passed values are ignored.
For "static" members you don't need an instance, BUT then that value
would be shared between all instances (read: users) of that page.

Now for the good news, there are several options:
* pass it in the querystring
* use Session to store user-specific data (often a good choice)

Hans Kesting
 
If you use Server.Transfer to go to the second page, then you can store data
to pass to the second page in HttpContext.Current.Items -- it's a state bag
that lasts for the request.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top