Actually i am currently developing a website. Which involves oracle database access....

And my problem is that i am not able to access the variable from the home page or the login page from another page. please help in doing so,,,

thank you,,

Recommended Answers

All 3 Replies

My first question for you would be this... how are you passing the variable?

Are you passing the variable in a session? Cookie? as part of the calling URL?

If a variable is declared in one page of the site and then an attempt is made to call it from another page in the site, unless it's 'passed' somehow then it doesn't exist. Variables are generally 'local' to the page they are created in (similar to how they're local to the form they're created in within a win-app, only you can't just reference the original form to call the variable).

Method 1 - Pass values via QueryString
Method 2 - Pass values via cookie
Method 3 - Pass values via session

Also, there's a helpful set of references on the msdn site specifically about methods of passing info from page to page in an ASP.Net site.

If, on the other hand, this is not what you need, perhaps a more detailed explanation of your problem coupled with some code snippets to show where the specific issue is would help others find a better solution.

Hope this helps :) Please remember to mark your thread solved once the issue is resolved.

If you want to access the variables on a page from outsider page then just declare them public.

later defining variables public you can access these variables by creating object of class.

If you want to access the variables on a page from outsider page then just declare them public.

Is it possible you're confusing C# with ASP.Net here?

In ASP.Net each page is considered to be, in essence, it's own separate entity. Unless variables are explicitly passed from one to the other, they do not exist outside the page they were created in.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.