473,396 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Redirect to root page

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

Nov 19 '05 #1
6 5990
Rudy Soto wrote:
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");

--
Rob Schieber
Nov 19 '05 #2
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

Nov 19 '05 #3
Rudy Soto wrote:
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?

--
Rob Schieber
Nov 19 '05 #4
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?

"Rudy Soto" <ru***@betenbough.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
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

Nov 19 '05 #5

Rudy -

use "~/<subfolder1>/<subfolder2><Page>.aspx" To all the way back to
original folder, if your in some nested subfolder.

use "../" to go back one subfolder up the tree

use "../../<Page>.aspx" to go two subfolders up the tree (so-on and so
forth)

if your going to have a complicated subtree structure, then I would
create a Page (i.e., Default.aspx) that contains the logic of where the
end user will go (use Session objects or Query String to figure that
logic out). But then do a Response.Redirect("~/default.aspx") on all
your click events no matter where your at in the tree structure...

it may have a lot of bouncing along...from page to defaultpage to real
page, but the code would be pretty easy to follow...
--
rviray
------------------------------------------------------------------------
rviray's Profile: http://www.msusenet.com/member.php?userid=4211
View this thread: http://www.msusenet.com/t-1871083597

Nov 19 '05 #6
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/customer....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

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sean Berry | last post by:
Hi there. I am relativly new to Python CGI and need a question answered. I have made custom 404 error pages and have them in various web directories. I have not been able to figure out a way...
2
by: Robert Gordon | last post by:
I now realize I probably should have tried posting this on the IIS board first.. I am running OWA 2003 Server as Front End server to my Exchange 2000 native domain. The FE server is secured by...
3
by: Hans | last post by:
Hi there, I have a number of domain names and they all point to the same IP address. I would like to redirect to a specific folder, based on the domain name used to access the site. For example....
5
by: PaulThomas | last post by:
Working with XP-Pro and VS.Net I have set my Start Page to "Home.aspx" but the application always starts the "Login" page - - - How can I change the start page to the Home.aspx??? On the login...
0
by: WebHouse.Co | last post by:
Hi Sir I'm in my 2nd year in M.Sc. degree & I made a project about the powerful tools SQLXML 3.0 & updategram, so I made a list of programs which r they so similar to the example that using...
4
by: Marty U. | last post by:
I have a Session variable I need to check the value of. If it is value a then redirect to some page. I need to implement this in a user control that is on all the relevent pages. I placed the if...
3
by: Calvin KD | last post by:
Hi everyone, I don't know if there's anyone out there is having the same problem. My DotNet 1.1 version uses FormsAuthentication.RedirectFromLoginPage() method to take user from the Login page to...
4
by: Matt MacDonald | last post by:
Hi everyone, I'm seeing this problem more and more often. Not sure if it's me or IIS or both. Here's the general scenario: I have an ASP.net app that is running and I try to navigate to...
2
by: Sergej Prokoviev | last post by:
We are running our site at www.waynesavings.com on secure hosting (Server 2003, IIS). We are using a custom 403.4 error page (called 403_4.asp, located under root) to redirect all users to https if...
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.