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 / General / September 2007

Tip: Looking for answers? Try searching our database.

ASP.NET Image tags with local src values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robbe Morris - [MVP] C# - 18 Sep 2007 20:54 GMT
I've never had to do this before...

I have a web app that needs to look for image files outside the
web site folders if it is run on localhost but look for the image files
in sub folders of the web site if run anywhere else.  And yes, there
is a logical reason for this...

For some reason, I can't get the local image file to be rendered
in the page when going to localhost:

<asp:ImageButton ID="ImageButton1" runat="server"
ImageUrl="file:///D:\inetpub\Submit_en-us.gif" OnClick="imgSubmit_Click" />

I know that this is the proper path as I pasted it into a test.htm file and
the image
file showed up properly.

This seems rather odd.  Anyone with insight?

Signature

Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials/aspnet/270e9432-d236-47e7-b1af-5cd3abe27a75
/net-propertygrid-control.aspx

Cowboy (Gregory A. Beamer) - 18 Sep 2007 22:11 GMT
You cannot do it this way. But, you can set it up to get the image locally
and serve it through an image handler. Something like:

<img src="imageHanlder.aspx?id=1234" />

This is a fairly common activity.

If you must stick with your method, you will either have to customize your
own image button control or move to an HTML image control. This will avoid
the url writing of the string.

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************

| Think outside the box!

*************************************************
> I've never had to do this before...
>
[quoted text clipped - 15 lines]
>
> This seems rather odd.  Anyone with insight?
Robbe Morris - [MVP] C# - 18 Sep 2007 22:16 GMT
Crap.  I was afraid of that.  Thanks for the quick response.

Signature

Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials/aspnet/270e9432-d236-47e7-b1af-5cd3abe27a75
/net-propertygrid-control.aspx


> You cannot do it this way. But, you can set it up to get the image locally
> and serve it through an image handler. Something like:
[quoted text clipped - 28 lines]
>>
>> This seems rather odd.  Anyone with insight?

Rate this thread:







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



©2008 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.