Help on error : Invalid path for child request ???

G

Guest

Dear all,

I have an ASP 1.1 application wchich need to extract data of a particular
selected day by users. When day has been selected from a calendar control the
following code is run :

Server.Transfer("ReelDay.aspx?day=" & m_day.ToString)

After this the following erro occurs :

Invalid path for child request 'ReelDay.aspx?day=3/2/2006 00:00:00'.
A virtual path is expected.

WHat is going on here, I have use that time of passing querry string in
other place in my code without any problem

thanks for your help
regards
serge
 
J

Jason Hales

Hi Serge,

You can't pass query string values using Server.Transfer - just the
name of the ASPX page which must be in the same web application.

I think the use of "/" characters is making ASP.NET think you're
referring a relative file path.

But don't forget that you can preserve the values of variables between
pages via server.transfer by deriving your pages from the same base
class (rather than System.Web.UI.Page) and then casting
Context.Handler to your base class type in your second page:

BasePage basePage = (BasePage)Context.Handler;

Here you can get the properties/varianles from your basePage

Here's a good article on the subject
http://msdn.microsoft.com/library/d...conpassingservercontrolvaluesbetweenpages.asp
 
B

Bruce Barker

server transfer work by creating an intance of the page requested, and
running the page cycle on it, the request is the same request as the page
calling transfer. you can not add more request variables to the request (its
readonly), so no url valiables can be added with server transfer.

-- bruce (sqlwork.com)
 
G

Guest

Hi bruce.

I cross check some point . Your are talking about request page called on the
same page.
I have to tell you that the calendar control container is a page named
ReelHistory.aspx

Then when I click on a day of calandr control, I have calling that code:

Server.Transfer("ReelDay.aspx?day=" & m_day.ToString)

to go to page ReelDay. So i am not in the same page request when doing that
????

regards
serge
 
G

Guest

Hi bruce, thnaks for your answer but I ma sorry I did not catch at all what
do you mean by instance reques or frirst request. ???

I have used this in many place in my code and did not get that trouble , wht
it occurs now.

Thnaks to be clear I am new in that

regards
serge
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top