PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?RGF2ZQ==?=
Guest
Posts: n/a
 
      10th Aug 2005
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
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      10th Aug 2005
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" <(E-Mail Removed)> wrote in message
news:972699D4-827E-4668-805E-(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?RGF2ZQ==?=
Guest
Posts: n/a
 
      11th Aug 2005
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" <(E-Mail Removed)> wrote in message
> news:972699D4-827E-4668-805E-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is there a way to make floating data blocks on the page pat Microsoft Excel Misc 1 29th Aug 2008 05:26 AM
Can I make down arrow not skip a page in Word 2 page print layout? kry Microsoft Word Document Management 3 6th Mar 2008 04:58 PM
how to make the data source safe?(Data Access Page) =?Utf-8?B?ZmFpenVsLmF6cmk=?= Microsoft Access Security 0 11th Oct 2007 06:15 AM
If no data, don't make a page Terry Lo via AccessMonster.com Microsoft Access Reports 1 25th Jan 2005 02:35 AM
How to make a page stay open only for few soconds, then redirect automaticaly to another page NWx Microsoft ASP .NET 3 16th Feb 2004 05:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:49 PM.