473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

ASP.NET Image tags with local src values

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?

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


Sep 18 '07 #1
2 1709
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.

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

*************************************************
| Think outside the box!
|
*************************************************
"Robbe Morris - [MVP] C#" <in**@eggheadcafe.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
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?

--
Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


Sep 18 '07 #2
Crap. I was afraid of that. Thanks for the quick response.

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:%2*******************@TK2MSFTNGP06.phx.gbl...
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.

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

*************************************************
| Think outside the box! |
*************************************************
"Robbe Morris - [MVP] C#" <in**@eggheadcafe.comwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>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?

--
Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


Sep 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: tvmaly | last post by:
Does anyone know if it is possible to determine if an image is horizontal/vertical and color or black & white using the python image library? I have been searching this news group and the...
8
by: Lars Netzel | last post by:
Hey! I wrote a message yersterday and got some good answers and have now managed to generate a nice image. The problem is that it's all generated in an Images.Aspx file and I don't really want...
8
by: handersonVA | last post by:
Hello, I'd like to put small images around a big image, so when a small image is clicked, that image is shown as a big image in the center. how should I do that? I will use a table tag to organize...
5
by: MilanB | last post by:
Hello, I have images in local server directory. Can I stream down image into HTML WebForm, on place reserved to specific image, and show to clients. I wish to avoid coping images to virtual...
6
by: nichughes | last post by:
Hello all, A question relating to http://www.entrust-systems.net/ Just for a change I have run into a problem that seems to be OS specific rather than browser specific - the box image that is...
5
by: Camet | last post by:
I have been trying to create a dynamic id for a number of images in a table so that I can identify which image was clicked on later. ie I need to set a variable to the id of each image, that is...
3
by: CD | last post by:
An application is logging faxes sent in SQL2000 image column type. I have found code on the net but what it is doing is prompting to save to local which is fine for single page image. Not good...
1
by: sourcie | last post by:
I am changing an existing quiz found on "JavaScriptKit.com Multiple Choice Quiz" I have an image. Instead of using the radio buttons with the normal true/false question, I want to place two...
1
by: sravani1 | last post by:
This code runs like when i submit the form it takes the image and displayed and top of the image a map will displayed. But actually i want that when i give the image it checks the location in the map...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.