Can I make OleDb data in one page available to another page

Discussion in 'ASP .Net' started by =?Utf-8?B?RGF2ZQ==?=, Aug 10, 2005.

  1. I'm fairly new to this ASPX/OLEDB stuff. I have an OleDbDataReader in one
    ..aspx page. I do a Server.Transfer to another page. Is it possible to make it
    so that the data in the OleDbDataReader is available to the other page, so I
    don't have to go back to the database?
    --
    Dave
    =?Utf-8?B?RGF2ZQ==?=, Aug 10, 2005
    #1
    1. Advertising

  2. Hi Dave,

    When you use Server.Transfer to transfer from one Page to another, the first
    Page remains as the HttpHandler in the Context. So, you can access any
    public value in the first Page class via something like the following:

    FirstPageClass firstpage;
    if (!IsPostBack) // Via Server.Transfer
    {
    firstpage = (FirstPageClass)Context.Handler;
    }

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Everybody picks their nose,
    But some people are better at hiding it.

    "Dave" <> wrote in message
    news:...
    > I'm fairly new to this ASPX/OLEDB stuff. I have an OleDbDataReader in one
    > .aspx page. I do a Server.Transfer to another page. Is it possible to make
    > it
    > so that the data in the OleDbDataReader is available to the other page, so
    > I
    > don't have to go back to the database?
    > --
    > Dave
    Kevin Spencer, Aug 10, 2005
    #2
    1. Advertising

  3. Thanks Kevin. That works fine. However, it sems to only work in the Page_Load
    event. I'd like to be able to get at the information in other places, like in
    a button click event, but it doesn't seem to work. Do you know the trick for
    this, or am I being too ambitious?
    --
    Dave


    "Kevin Spencer" wrote:

    > Hi Dave,
    >
    > When you use Server.Transfer to transfer from one Page to another, the first
    > Page remains as the HttpHandler in the Context. So, you can access any
    > public value in the first Page class via something like the following:
    >
    > FirstPageClass firstpage;
    > if (!IsPostBack) // Via Server.Transfer
    > {
    > firstpage = (FirstPageClass)Context.Handler;
    > }
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > ..Net Developer
    > Everybody picks their nose,
    > But some people are better at hiding it.
    >
    > "Dave" <> wrote in message
    > news:...
    > > I'm fairly new to this ASPX/OLEDB stuff. I have an OleDbDataReader in one
    > > .aspx page. I do a Server.Transfer to another page. Is it possible to make
    > > it
    > > so that the data in the OleDbDataReader is available to the other page, so
    > > I
    > > don't have to go back to the database?
    > > --
    > > Dave

    >
    >
    >
    =?Utf-8?B?RGF2ZQ==?=, Aug 11, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Henry

    Data type question for OLEdb data types

    Brian Henry, Oct 4, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    594
  2. Brian Foree
    Replies:
    3
    Views:
    7,238
    Brian Foree
    Jan 26, 2005
  3. psychomad
    Replies:
    2
    Views:
    5,205
    Alexey Smirnov
    Apr 10, 2007
  4. Robert Cohen
    Replies:
    3
    Views:
    270
    Andrew Durstewitz
    Jul 15, 2003
  5. Blackberry
    Replies:
    0
    Views:
    152
    Blackberry
    Sep 22, 2007
Loading...

Share This Page