473,796 Members | 2,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Conrols(.ascx) - Relative Paths

C
Hi,

I have a User Control (.ascx) which has links to all the ASPX Pages that
exist in my application.

This User Control is used on all my ASPX's.

I am havinga problem with the paths in my ASCX.

If I click on a link from an ASPX page on the root of the project it works
fine.

If I click on the link from any pages in any subfolders withing the web
project it cannot get to the ASPX.

My question is : How can I set the paths in the ASCX so that the links will
work from any ASPX?

Thanks.
May 12 '06 #1
3 3036
Hi there,
in order to get all the links work from all of you pages you cannot use
reletive paths (../image/test.jpg). You can use full paths that
should solve you problem.
The way I got around this problem was I created a sub folder that
everyone had access to it, and moved all the ASPX files that where in
the root directory (except the login page) to this new directory. and
then I was able to use reletive paths.
Leyla

May 12 '06 #2
Hi there,
in order to get all the links work from all of you pages you cannot use
reletive paths (../image/test.jpg). You can use full paths that
should solve you problem.
The way I got around this problem was I created a sub folder that
everyone had access to it, and moved all the ASPX files that where in
the root directory (except the login page) to this new directory. and
then I was able to use reletive paths.
Leyla

May 12 '06 #3
why not just use ~ in all your links with a runat="Server" ?

<a href="~/someFolder/File.aspx" runat="server"> blah</a>

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"C" <C@discussions. microsoft.com> wrote in message
news:8B******** *************** ***********@mic rosoft.com...
Hi,

I have a User Control (.ascx) which has links to all the ASPX Pages that
exist in my application.

This User Control is used on all my ASPX's.

I am havinga problem with the paths in my ASCX.

If I click on a link from an ASPX page on the root of the project it works
fine.

If I click on the link from any pages in any subfolders withing the web
project it cannot get to the ASPX.

My question is : How can I set the paths in the ASCX so that the links
will
work from any ASPX?

Thanks.

May 12 '06 #4

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

Similar topics

2
1944
by: d.schulz81 | last post by:
Hi all, We have about 10 different domains that are linked very closely and we want to identify and track every single user that surfs our websites. Later we want to analyse user paths and find out the search robots with the referring search words. What are the possibilities? Cookies are not accepted by 40 % of our users and in addition to that for each domain a different cookie is created what makes it really
15
2910
by: Nick K. | last post by:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I found that there is an include file that references images: <img src = "/images/Header.gif" What worked correctly on the production server breaks on mine because of the absolute address "/images". I removed the absolute address and changed...
1
3025
by: Martine | last post by:
Hi there! I have a problem with programmatically adding user controls to my mobile webforms. If I load my usercontrol programmatically (in the Page_Load), the object is instantiated, I have access to the methods and properties from the Page_Load, no problem there. But as soon as I want access to the user control from another procedure on the same page, I get the next error message: "Object reference not set to an instance of an...
6
2792
by: tshad | last post by:
I have an ascx file I am using to include my logos and heading information for all my pages. It was working fine up until now. I decided to set up an admin folder inside of my main folder and move one of my files into it - now my links don't work. I have a setup:
2
1824
by: Nathan Sokalski | last post by:
When I put my *.ascx files in the same directory as Web.config and my user controls are registered in Web.config it gives me an error. Putting my *.ascx files in another directory is not hard, but it can cause another annoyance: relative directories. For example, that means that I need to write code to add a ../ to the beginning of all relative directories used in the user controls, which can be a real pain, especially if the directory is...
5
1231
by: shapper | last post by:
Hello, I have been trying to add a user control at runtime to a page: Dim myUserControl As Control = LoadControl("MyUserControl.ascx") The problem is this does not give me access to the user control properties. So I tried the following: Dim myUserControl As MyUserControl =
8
2658
by: kyosohma | last post by:
Hi, I am trying to query our domain to get a list of our users profile locations. I thought I might be able to use WMI, but I can't get it to work. I am using a Windows XP Pro workstation and Python 2.4 on a mixed environment of Debian Linux (with Samba) and Windows servers. We are in the process of moving the user profiles from an NT box to a Debian box, but due to the many different servers in the organization, it is a pain to keep...
2
1942
by: germ | last post by:
I am moving a web application from 1.1 to 2.0 This site builds pages dynamically as : PlaceHolder.Controls.Add(LoadControl("~/Controls/Ctl1.ascx")); Everything is working fine as long as the web site is updateable - the .ascx files exist on disk. I would like to use the non-updateable and single assembly options - no ..ascx files. I thought that maybe this would work :...
2
4311
by: Peted | last post by:
Hi i have a circumstance where a user unzips a file, with a certain layer of directories to get to a textfile. So in any directory on the HDD they may end up with something like dir1/dir2/dir3/dir4/dir5/file.txt
0
9528
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.