Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / March 2006

Tip: Looking for answers? Try searching our database.

Image in Designer (VS 2005)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shawn B. - 18 Mar 2006 09:26 GMT
Greetings,

I'm creating a custom server control.  In the design-time experience, I'd
like to render an image where the control is placed.  I have an /images
folder in my website.

The problem is, when I render the <img src=... tag during the design-time
experience, nothing displays.  When I run the web, it works fine.  I've even
try hardcoding the URL (based on an IIS path), and that doesn't work either.

My question is simple: how do I reference a root relative URL during
designtime in a custom server control?  Page.MapPath throws a null reference
exception.  Perhaps theres something else I can use?

Thanks,
Shawn
Antonio Bakula - 28 Mar 2006 13:08 GMT
> My question is simple: how do I reference a root relative URL during
> designtime in a custom server control?  Page.MapPath throws a null reference
> exception.  Perhaps theres something else I can use?

I had an check if is designtime (is Site assigned) and if assigned then I
copied image in temp directory and set this new filename to ImageUrl (my
component inherits from WebControls.Image)

But my control used images from stream, I really don't know how will you
know *where* your pictures are.

btw. if it helps here is the link to my stream image component, source
included.

http://www.antoniob.com/projects/PStreamImage.aspx

beware: Delphi.NET and framework 1.x !!

Signature

http://www.antoniob.com/
remove antispam XremoveX from e-mail !


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.