Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > User control + relative path

Reply
Thread Tools

User control + relative path

 
 
Alex
Guest
Posts: n/a
 
      10-18-2004
Hi. I need some help on this.
I have a user control (a header) in my root directory, and all my pages use
that control. Then a created a folder (in my root directory) and put a new
page inside it, and that page use the same control, but this time the
control can't find it's images and resources because it is trying to find it
in the same folder instead of the root directory. Now, I know that I can
change the control image's relative paths for absolute paths, but then when
I upload my application to the real server I have to change all the paths
again. Of course I could make a copy of the control in my new folder but
then I have to copy all the images and everything too.
Is there some simple way of dealing with that?
Thanks,
Alejandro Penate-Diaz.


 
Reply With Quote
 
 
 
 
Drew Robbins
Guest
Posts: n/a
 
      10-18-2004
You can use a path like "~/Controls/MyControl.ascx". The '~' character
is replaced with the Application root path at runtime. It's a nice
compromise between relative and absolute paths.

Alex wrote:
> Hi. I need some help on this.
> I have a user control (a header) in my root directory, and all my pages use
> that control. Then a created a folder (in my root directory) and put a new
> page inside it, and that page use the same control, but this time the
> control can't find it's images and resources because it is trying to find it
> in the same folder instead of the root directory. Now, I know that I can
> change the control image's relative paths for absolute paths, but then when
> I upload my application to the real server I have to change all the paths
> again. Of course I could make a copy of the control in my new folder but
> then I have to copy all the images and everything too.
> Is there some simple way of dealing with that?
> Thanks,
> Alejandro Penate-Diaz.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User control + relative path Alex ASP .Net 3 05-22-2008 09:57 AM
FileUpload control doesn't work (fail in client side early stages) when path is relative i.e "\\path.." Oren ASP .Net 1 04-29-2007 04:20 PM
Specifying Root Relative Path in User Control Guadala Harry ASP .Net 1 04-27-2005 05:01 PM
User control + relative path Alex ASP .Net Building Controls 1 10-18-2004 06:33 PM
absolute path versus relative path in JSP Matt Java 3 07-08-2004 08:31 PM



Advertisments