Connecting Tech Pros Worldwide Forums | Help | Site Map

passing parameter

Khamal
Guest
 
Posts: n/a
#1: Nov 19 '05
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 ::



Hans Kesting
Guest
 
Posts: n/a
#2: Nov 19 '05

re: passing parameter


Khamal wrote:[color=blue]
> 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...[color=green][color=darkred]
>>> KHAMAL ::[/color][/color][/color]

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


Brock Allen
Guest
 
Posts: n/a
#3: Nov 19 '05

re: passing parameter


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
[color=blue]
> 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...
>[/color]


Closed Thread