passing values between web forms pages

  • Thread starter Thread starter rick
  • Start date Start date
R

rick

Does anyone having a working example of passing values
between web forms pages? I tried the example in the ms-
help but I can't get by the following:

To read property values from the source page in the call
page.
1. Create a global instance varible that is typed to the
class of the source page.
the sample provided

// c#
// Put immediately after the opening brace of the class
public class WebForm3 : System.Web.UI.Page
{ public WebForm1 sourcepage;

at this point it does not recognize WebForm3.

thanks
 
rick said:
Does anyone having a working example of passing values
between web forms pages?

You can send them along as part of the querystring or use Session variables.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
 
I would recommend you read up on querystrings.

A simple search in google, will probably return hundreds.

-mike
 
If you want all of your pages to be able to access some data, then Session
variables will probably work for you.

Do somethign like this

Session["YourData"] = ((int) Session["YourData"]) ;

You can declare your variable just like this:
Session["YourData"] = whatever;

And you can retrieve it like this

int i = ((int) Session["MyServiceUsage"]) + 1;

HTH,

Bill
 
Back
Top