User Conrols(.ascx) - Relative Paths

G

Guest

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.
 
L

Leyla

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
 
L

Leyla

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
 
K

Karl Seguin [MVP]

why not just use ~ in all your links with a runat="Server" ?

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

Karl
 

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

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top