User Conrols(.ascx) - Relative Paths

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
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
 
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

Back
Top