473,387 Members | 1,585 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,387 software developers and data experts.

asp:Image

115 100+
Hey up
Me again
I am trying to display a single image on my web page using a asp:image tag

Expand|Select|Wrap|Line Numbers
  1. <asp:Image runat="server" id="picture one" AlternateText="SillyPicture" ImageUrl="C:\Users\username\sillypicture.jpg />
  2.  
Is there any reason why this shouldn't work. I am pretty new to asp.net so any input would possibly be a help
Feb 19 '09 #1
5 1693
Frinavale
9,735 Expert Mod 8TB
The reason this isn't working is because the image isn't located on the Web Server and therefore the web pages cannot access it.

Place the image in your web application to be sure that it is on the web server.
Feb 19 '09 #2
truezplaya
115 100+
Sorry when you say in my web app do you mean in the same file as the web application.It doesn't seem to work:(. If you can point me to tutorials then thats helpful as well. I am running it through visual studio
Feb 19 '09 #3
Frinavale
9,735 Expert Mod 8TB
I don't think tutorial will help you here (I doubt there is any for this).
The only way that your web browser can access an image is if it exists on the web server...and you need to provide the image with a URL to locate the image on the server.

Add the file to your web application via Visual Studio....


Or better yet add a folder named "Images" to your web application via Visual Studio.
Add the image to this folder.
Then change your Image control so that it points to the URL of the image:
Expand|Select|Wrap|Line Numbers
  1. <asp:Image runat="server" id="picture one" AlternateText="SillyPicture" ImageUrl="~/Images/sillypicture.jpg /">
-Frinny
Feb 19 '09 #4
truezplaya
115 100+
Cheers got it going now!
Feb 19 '09 #5
Frinavale
9,735 Expert Mod 8TB
Awesome :)
Feb 19 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John Scott | last post by:
I am storing an image in an SQL database and have one field as an image datatype. I am also using a webservice to transport data. I want to be able to resize the image and pass back a thumbnail...
0
by: Daisy | last post by:
Is there any way in an ascx (without resorting to a codebehind file) to have a client-side onload event on an asp:image tag? I've just changed from a normal image, to an asp:image tag, but now it...
1
by: Chris Fink | last post by:
Hello, Does anyone know of a way to handle broken href image tags either by using the html img tag or the asp:image server control? For example, if my src attribute is broken, I would like to...
6
by: C K | last post by:
What is less expensive/intensive on the server -dynamically writing out my rollovers to an asp:literal, or to use asp:image tags for the images. My image names will be dynamic as I am building a...
2
by: Chris Dunaway | last post by:
I was looking over some asp.net code and saw this asp:Image control: <asp:Image ImageUrl="~/images/logo.gif" runat="server" ID="Image1"/> What does the tilde (~) mean in the ImageUrl...
0
by: DavidS | last post by:
I have HTML web page with <asp:Image id=img_L runat=server ImageAlign=Top Visible=True Width=y Height=x></asp:Image>. For some images, less than 128K I can view image. Other image files > 128K,...
4
by: Deere | last post by:
When I try to take a database field and change it with a function and return it...it will not display the image. The "Imageurl" does not convert to "src=" but stays as ImageUrl. id=Image2 will...
3
by: Switch4Mac | last post by:
Hi, I want to insert an ad in my MasterPage. So in the MasterPage, I have this piece of code: <asp:Image ID="GatesAd" runat="server"...
0
by: Christian Schlemmer | last post by:
hi, in a DetailsView i have a image display. images i want to store in a seperate directory, but it a path is added to Bind update and delete is not working. just Bind makes my...
3
by: Paul Cheetham | last post by:
Hi, I have an application that will display user-defined images in some asp:image controls. (sets the ImageURL, and is always built from the site root) The problem comes when the images...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.