Response.Redirect and Server.Transfer

  • Thread starter Thread starter VapidGav
  • Start date Start date
V

VapidGav

Ok I am going a bit insane here.

I have written a class which handles redirects to certain pages according to
database settings. When I use the response.redirect from within my class I
get this error message

Server Error in '/Application' Application.
----------------------------------------------------------------------------
----

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make sure that
it is spelled correctly.

I have checked the path and it seams fine. What gets me is that if I put
the page in the same directory structure it works fine. So my default.aspx
and login.aspx pages are in the same dir then works. But if I put my
login.aspx page within a seperate directory (eg pages/login.aspx) then I get
this error.

Anybody seen this before?

Thanks

Gav
 
Anybody seen this before?
hhhmmm sounds like a absolute vs relative page references problem. What
happens if you try putting the tilde (~) at the front of the string to
represent the webapp path? What happens if you put the absolute
http://localhost/webappname/somedir/somewebpage.aspx? If one or both of
those work then it's most definitely a problem with accessing the page via
relative references.

What did you find?
 
Hi Flip

I have got it to work right now. Basically I have this under the Default
Web on Server 2003 as a virtual directory. So say its like this
(http://localhost/Application/profiles/login.aspx) I was giving it
profiles/login.aspx and wasnt applying the Application part which is
declared as a virtual directory in IIS

Very weird and I have been trying to get this to work all day.

Dont understand fully why you have to add in the virtual directory name?
Any thoughts?

Gav
 
Dont understand fully why you have to add in the virtual directory name?
Any thoughts?

I think the Application part is the webapp name? I read on the weekend what
IIS sees as the webapp is not what you and I think of as the webapp, but the
"Application" piece is the webapp name as far as you and I are concerned
IMHO. :> Did you hard code it in there? What happens when you try to play
with the "~" tilde character instead? That might be a better suggestion
instead of hardcoding. The tilde is a place holder for the absolute path
which gets translated at runtime.

Here's an interesting link I used before.
http://dotnetjunkies.com/WebLog/jpalermo/archive/2004/11/06/31227.aspx
 
Back
Top