challengeAccepted
challengeAccepted

Reputation: 7590

How to use local variable of a function in different page, Vs 2005, asp.net

How to use a local variable of a function of a control in a different page in Asp.net.

I am new, please help me out!

Thanks!

Upvotes: 0

Views: 177

Answers (1)

Kirk Woll
Kirk Woll

Reputation: 77536

You cannot do this because:

  1. Local variables are not accessible outside of the method they are declared in (did you mean fields?)
  2. Pages from one request do not even exist when you're on a new page during the subsequent request. It's stateless.

Consider using cookies/viewstate/query strings/etc.

Upvotes: 1

Related Questions