473,287 Members | 2,682 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,287 software developers and data experts.

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 3016
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**********************************@microsof t.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
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...
15
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...
1
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...
6
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...
2
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...
5
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...
8
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...
2
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...
2
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 ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.