473,386 Members | 1,699 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,386 software developers and data experts.

Redirecting in a usercontrol

If I try to redirect in usercontrol using only a relative url like
Response.Redirect("somepage.aspx") it will fail several places since it
tries to find the page in the folder whcih the user control is used in. One
solution is to use an url like
Response.Redirect("/somefolder/somepage.aspx"). My problem with this
solution is that it dosen't work when running on localhost. Are there any
other solutions?

Eirik Eldorsen
Nov 18 '05 #1
2 939
You can use ~ to specify the application's root:

Response.Redirect("~/somepage.aspx", true);

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Eirik Eldorsen" <ku*******@hotmail.com> wrote in message
news:uq**************@tk2msftngp13.phx.gbl...
If I try to redirect in usercontrol using only a relative url like
Response.Redirect("somepage.aspx") it will fail several places since it
tries to find the page in the folder whcih the user control is used in. One solution is to use an url like
Response.Redirect("/somefolder/somepage.aspx"). My problem with this
solution is that it dosen't work when running on localhost. Are there any
other solutions?

Eirik Eldorsen

Nov 18 '05 #2
Wow! Thanks! I did'nt think there were any other solutions. Testing on
localhost will be so much easier now :-D
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:up**************@TK2MSFTNGP10.phx.gbl...
You can use ~ to specify the application's root:

Response.Redirect("~/somepage.aspx", true);

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Eirik Eldorsen" <ku*******@hotmail.com> wrote in message
news:uq**************@tk2msftngp13.phx.gbl...
If I try to redirect in usercontrol using only a relative url like
Response.Redirect("somepage.aspx") it will fail several places since it
tries to find the page in the folder whcih the user control is used in.

One
solution is to use an url like
Response.Redirect("/somefolder/somepage.aspx"). My problem with this
solution is that it dosen't work when running on localhost. Are there any
other solutions?

Eirik Eldorsen


Nov 18 '05 #3

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

Similar topics

8
by: Raed Sawalha | last post by:
Hi, I have a strange problem with a usercontrol on a page. The usercontrol dispalyes three categories (From a database) when the user clicks a category they see all the products in a shop for...
5
by: darrel | last post by:
I'm trying to set up a usercontrol that I can put on specific pages to authenticate people via their network login on our intranet. I have this in the config file: <authentication mode="Windows"...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
8
by: Morpheus | last post by:
I am trying to test a function that outputs text to the standard output, presumably using a cout call. I do not have access to the source, but need to test the output. Is this possible? I can...
6
by: MeowCow | last post by:
I have created a UserControl that encapsulates a third party data grid. My goal was to create my own DataSource and DataMember properties that forward the binding to the third party grid, then use...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.