Re: Accessing variables
From: krishna c kanthety (kkanthety@metrobat.com)
Date: 12/05/02
- Next message: Larry Hastings: "Re: User ASPNET in SQL Server 2000"
- Previous message: PPaps: "Client Connection"
- In reply to: David S: "Re: Accessing variables"
- Next in thread: David S: "Re: Accessing variables"
- Reply: David S: "Re: Accessing variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "krishna c kanthety" <kkanthety@metrobat.com> Date: Thu, 5 Dec 2002 08:50:43 -0500
Hi David,
I used Context.Items("Dept") = DropDownList.SelectedItem.Value in my first.aspx..and i am able to display it in my second.aspx using l.Text = context.Items("Dept")....but when i am trying to display it in my Third.aspx using ll.Text = context.Items("Dept")..its showing me a null value...I am using Server.Transfer() to execute second and third pages....
Also i noticed an other weird thing..when i click the button in my first page which has (Server.Transfer("second.aspx") in it as code ..its going to the second.aspx..but the URL in my browser still showing http://localhost/ss/first.aspx...and when i click the button in my second.aspx..its goin to the third.aspx..but the URL now is showing http://localhost/ss/second.aspx.....
I am using Server.Transfer() to go from one page to another..could u please explain whats goin on..thanks in advance..KC
"David S" <nospam@nospam.com> wrote in message news:ejGa2C8mCHA.1604@TK2MSFTNGP08...
> If you are using Server.Transfer or Server.Execute to control the
> first.aspx->second.aspx->third.aspx flow, you can use the Context property.
> To write a value to it from your first page:
>
> Context.Items("someKey") = <someValue>
>
> You can then read the value from your third page by referring to
> Context.Items("someKey"), converting it to the specific data type as
> necessary.
>
> If the flow from first.aspx->second.aspx->third.aspx happens any other way,
> I think the Session property is probably your best bet. Its use is very
> similar to that of Context. I hope that helps you.
>
> --
> Dave
> www.DavidSolum.com
>
> "krishna c kanthety" <kkanthety@metrobat.com> wrote in message
> news:OglCD#7mCHA.2172@TK2MSFTNGP12...
> > Hi All,
> > i am trying to access the values in the variables that are defined in my
> > start page, from a third page..
> >
> > first.aspx->second.aspx->third.aspx
> > now i am trying to access the values in first.aspx into third.aspx
> > directly..i used the following code.
> > fp1 = CType(context.Handler, first)..but its givin me a null object
> > reference error..any ideas???
> >
> > thanks in advance..KC
> >
> >
>
>
- Next message: Larry Hastings: "Re: User ASPNET in SQL Server 2000"
- Previous message: PPaps: "Client Connection"
- In reply to: David S: "Re: Accessing variables"
- Next in thread: David S: "Re: Accessing variables"
- Reply: David S: "Re: Accessing variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]