|
-
February 17th, 2003, 09:40 PM
#1
how can I retrieve values of variables from one asp page to another??
Hello, Is there anyway one can access variables from one asp page to another? If there is not, how can one access those variables without having to use a form?
GabyGirl
-
February 18th, 2003, 03:34 PM
#2
You can either put them in the querystring or create session variables to hold the information.
-
February 18th, 2003, 07:00 PM
#3
http://msdn.microsoft.com/library/de...tweenpages.asp
Don't worry about the page template @reference directives. All you need to do is get a handle to IContextHandler in the code behind of the target page and cast it to the page that is sending the values.
You'll see what I'm talking about after you read this article. It sounds complicated but its really easy and not as annoying as session variables and query string parameters.
-
February 19th, 2003, 06:33 AM
#4
Hi Mike
I applied your suggested technique, it worked.
But when i try to access the second page by providing its url
it gives following error message.
...................................................................
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
if (!IsPostBack)
{
fp=(FormOne) Context.Handler;
}
-
February 19th, 2003, 11:10 AM
#5
Try this
if (!IsPostback) {
if (Context.Handler is FormOne) {
fp = (FormOne)Context.Handler;
}
}
-
February 20th, 2003, 12:16 AM
#6
Thank you
Thankyou Mike its working now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|