HighTechTalks DotNet Forums  

Image in Designer (VS 2005)

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Image in Designer (VS 2005) in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Shawn B.
 
Posts: n/a

Default Image in Designer (VS 2005) - 03-18-2006 , 02:26 AM






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



Reply With Quote
  #2  
Old   
Antonio Bakula
 
Posts: n/a

Default Re: Image in Designer (VS 2005) - 03-28-2006 , 07:08 AM






On Sat, 18 Mar 2006 00:26:27 -0800, Shawn B. wrote:

Quote:
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 !!


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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.