Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image pathing in user controls
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00798637
Message ID:
00798770
Views:
17
>I'll bet this is an easy question....
>
>My application directory structure is as follows:
>
>application_root
> ->images
> ->usercontrols
> ASPX files go in root
>
>I need to reference images in my user controls (so the pathing looks like "../images/someimage.gif") in my user control source.
>
>When I include the user control on a page and try to run it, the page (obviously) cannot find the image (since ../images takes me outside of my application root).
>
>My question is this, is there some way in the src="" attribute on my HTML controls to specify an application root relative path so that I can see the graphics in UserControl design mode AND when I run my application?
>
>Please say there is a way to do this....
>
>Mary Hintermeier
>RSA

Why not just put all of your images in a directory off of the root. And have the link be
"/images/imagename.gif"

That way where the usercontrol is called from

/usercontrol/uc.ascx
or the page calls it
in

/page.aspx

That images will continue to be there. You can then separate your images if there are too many.

/images/controls
/images/pages
/images/other

etc...

Hope that helps..
Morgan
Previous
Reply
Map
View

Click here to load this message in the networking platform