Redirect to root page

R

Rudy Soto

Can someone please tell me how I can redirect the user back to the
start page? Let's say I have the following folders in IIS, with the
pages included:

Menu
login.aspx
menu.aspx
Customers
details.aspx
contacts.aspx
address.aspx

menu.aspx also has other folders. It is basically the entry point for
multiple projects. Anyway, if a user has already navigated to
contacts.aspx for example, I want them to be able to return straight to
menu.aspx. If they have already logged in they will not be redirected
to login.aspx.

I've tried the following in the code behind of an asp:button, which is
part of a user control (hope that makes sense):

Response.Redirect("https://menu.mycompany.com/menu.aspx")
Response.Redirect("~/menu/menu.aspx")
Response.Redirect("/menu/menu.aspx")

None of these work. Does anyone have any suggestions? Maybe
Response.Redirect isn't even close to what I need to use?

Thanks.
Rudy
 
R

Rob Schieber

Rudy said:
Can someone please tell me how I can redirect the user back to the
start page? Let's say I have the following folders in IIS, with the
pages included:

Menu
login.aspx
menu.aspx
Customers
details.aspx
contacts.aspx
address.aspx

menu.aspx also has other folders. It is basically the entry point for
multiple projects. Anyway, if a user has already navigated to
contacts.aspx for example, I want them to be able to return straight to
menu.aspx. If they have already logged in they will not be redirected
to login.aspx.

I've tried the following in the code behind of an asp:button, which is
part of a user control (hope that makes sense):

Response.Redirect("https://menu.mycompany.com/menu.aspx")
Response.Redirect("~/menu/menu.aspx")
Response.Redirect("/menu/menu.aspx")

None of these work. Does anyone have any suggestions? Maybe
Response.Redirect isn't even close to what I need to use?

Thanks.
Rudy
Try Response.Redirect("../menu/menu.aspx");
 
R

Rudy Soto

Rob,

Thanks for the quick reply. I did try that and it worked.....on my
development machine. For some reason when we put it on the web server,
it does not. Any idea what the difference could be? Is there
something in the directory structure of IIS that we need to modify?

Thanks.
Rudy
 
R

Rob Schieber

Rudy said:
Rob,

Thanks for the quick reply. I did try that and it worked.....on my
development machine. For some reason when we put it on the web server,
it does not. Any idea what the difference could be? Is there
something in the directory structure of IIS that we need to modify?

Thanks.
Rudy

Hi Rudy,

That is the standard way to redirect, it should work on anny IIS asp
application. Is it possible that you didn't recompile the application
and redeploy the binary file?
 
P

Peter Rilling

When you run your site, what does happen? Do you get an exception or a 404
page? What is the URL in the address bar and how does that compare with
your actual tree structure?
 
R

Rudy Soto

It appears to just refresh whatever page it is currently on. The url
in the address bar does not change. The status bar does not show the
target url, because it is an asp:button and not an asp:linkbutton
(which may be part of the problem I guess). For example, the current
page I am looking at has this in the url:

https://menu.mycomplany.com/customers/Details.aspx?Key=5555

When I click the button nothing appears to happen except maybe a
refresh. The code currently behind the button is:

Response.Redirect("https://menu.mycompany.com/menu.aspx")

That is the url of the page I want to redirect to (names have been
changed to protect the innocent).

Rudy
 

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

Top