How to display a jpg image in Image Control

I have Image control on a web form and i was a write a following code for displaying image in image control. but it does not display image in image control at runtime.

   Image1.ImageUrl = "c:\My Documents\IMG_0510.jpg"
0
Ershad
7/7/2008 10:34:26 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

2 Replies
978 Views

Similar Articles

[PageSpeed] 8

I got the solution 

just one change in code of replacing forward slash to backward slash
Image1.ImageUrl = "c:/My Documents/IMG_0510.jpg"
0
Ershad
7/7/2008 11:07:20 AM

 I would like to suggest you that don't use the physical path for display image in image control. So you can use like that:-

If you are using Runat = "server" control so you can use this one. 

<asp:Image ID="ImageDisplay" ImageUrl="~/Image/xyz.gif" runat="server" />

 If you are using just HTML control so you can use this one.

<img src="../Image/xyz.gif"/>

 You can change the folder name ("Images").

 

 

 

0
manishprajapati
7/7/2008 11:14:32 AM
Reply:

Similar Artilces:

how to display image from web service in an image control
 Hi, I am using web service to fetch image from the video server, and displayed  in the web application, that is working fine,but I am using               Response.ContentType = "image/gif";              Response.BinaryWrite(arrpicture); but I want to display this image in the image control of the web application.Can any one help me out in this.Thanks,     You can do this using an HTTP Handler, using the same technique outlined...

Displaying image from database(image datatype) to image control
Hie all...I'm a newbie at asp.net. I m currently using asp.net 2.0.I m having a problem with displaying images on my web form. Have tried looking thru all codes but i can't find a step by step tutorial for doing so. I understand that in asp.net 1.1, the detailsview can automatically be linked to the image field and display the image. But this is not possible now. So, i have decided to just display the image in an image control.from my understanding, 1. retrieve image from database and convert it to temporary image file in a file path. 2. use the image control's imageurl to point to the file....

displaying image in image control
I am inserting the image from the image control in the sql server database. now i want to read the image from the databse and show that image in the image control. i am able to read the image in streams and i am not able it to assign it to image control.kindly help. Hi,have a look at this linkhttp://www.aspdotnetcodes.com/Insert_Images_Database.aspxThanks,  hai go through the links http://www.odetocode.com/Articles/172.aspxhttp://chiragrdarji.wordpress.com/2007/03/05/storing-and-retrieving-image-in-sql-server/ Regards,M.VenkatesanMy Blog : http://venkat-dotnetsamples.blog...

Display image in image control?
i am trying to retrive the image from sqlserver 2005 and how to put this image in image control in a web application?  See Saving and Displaying Photos in SQL Server using ASP.NETIf this post was useful to you, please mark it as answer. Thank you!...

How to Display Image on Image control
 Dear All forum memberI am using <cc1:FileUploaderAjax> </cc1:FileUploaderAjax> for uploading image to database.I want to display the image in a image control as soon as user will finish his  browse for selecting Image before going to database. If any other way is possible with out using <cc1:FileUploaderAjax> </cc1:FileUploaderAjax> , that will also fine for me, but it should be ajax enabled.Mark As Answer if it helpsThanks & RegardGyana Ojha...

How to display SQL Server Image column in a Image control in a web formview??
I have a SQL Server 2005 table with a column called WBTImage with a data type as image.  The images were already loaded into the table using a MSAccess program. I want to display the WBTImage column in a asp image control (imgTrain) on a web form.  There is no data binding property for the image column.  I have looked at many posts across many forumns and all of the solutions do not appear to work.  Some used the system.drawing,image.fromstream, some used binary.write, one showed a windows form with a data binding that I could not find and the other used a memorystream...

VB.NET web form Image control SizeMode
The "PictureBox" control in VB.NET has a property called "SizeMode". This allows you to choose how the image will display in the picture box if it is not the same size as the picturebox. However the "image" control for a VB.NET web form (in an ASP.NET application) does not have such a property, instead all images seem to be set to "StretchImage". I want them to be set to "normal", how can I do this? I thought of building my own user control but this would be silly because there must be a simpler way....

display image in a image image button
hi   i have to display an image in image button while uploading mycode Image1.ImageUrl = Upload.PostedFile.FileName; is not working thanks Hi You need to save the PostedFile to the disk on the server and then assign it to ImageUrl. Take a look at the following links for more infoprmation on how to do this.  http://www.codeproject.com/KB/aspnet/netimageupload.aspx http://www.stardeveloper.com/articles/display.html?article=2003022601&page=1Reza Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post that helped you. That way ...

Immediate Display image in image control
Hi, i have a file upload control and a image control in my page.i need when i upload a image immediate it show in my image control then i store it in my database. so,how can i display image in image control immediate upload a image? Thanking you. Subhakanta:i have a file upload control and a image control in my page.i need when i upload a image immediate it show in my image control then i store it in my database It doesnt show the image once you select the image through fileupload control1) first you upload the image ie: save it on you images Folder and call the file name bind to ...

Display image in image control from database?
Im looking for how to load an image in a database into an asp.net image control. I would like to be able to display images with assocated image captions in a page stored in a database. Samples I have found only deal with writing out the binary data directly into the page. Does anyone have a link on how to associate that image data in the database with an image control on the page? Have a look at this control in the control Gallery.  Should do what you want.JamesMy Blog: http://www.wintersfamily.plus.com/blogs/JamesWinters I found a few articles on this such as, http://blogs.ww...

How Image Display From SqlServer To Image Control
I have learned lots of informative thing from your forums. I have little problem regarding “Display image from SQL Server on ASP.NET” I have done it and image display on my page from SQL Server. I have cleared you here I have adopt two different methods which are following for displaying picture. 1. Response.BinaryWrite(rd("picture")) 2. image.Save(Response.OutputStream, ImageFormat.Jpeg) but in both above methods I have faced little problem when image display on my page all other information can not display and I also want to display picture on my specific location on the page. My se...

display an image in image control in FormsView
Hi,        How can i display an image in image control in FormsView ?? Only the filenames are stored in the db with varchar datatype. The physical files are stored in a directory called StudentPhotos under the root.   Thanks How about something like this: <asp:formview id="fv" runat="server" defaultmode="ReadOnly"> <itemtemplate> <asp:image id="img" runat="server" imageurl='<%# "StudentPhotos/" + Eval("image_filename") %>' /> </itemtemplate> </asp:formview>  Thanks, EdMicrosoft MVP - ASP/ASP.NET ...

image control displaying image that does not exist!!
I have an image control and I give it a path for an image to view. The thing is, that path once had an image but now it does not exist. Yet the deleted image still shows up in the image control! Its a ghost image! Please tell me what I am missing. Image2.ImageUrl = "~/img/scrap/Test.jpg" above line still causes Test.jpg to appear in the image control even though it has been deleted. Do I have to do some sort of purge? Thanks, Sam If you are sure abt that the image is not there... Try to Clean the Cache of the webpage.. and run the app..Better Post your code before asking some...

Image object displayed in Image control
I have a webpage called PersonDetails.aspx that makes a call to the server and the response includes a persons details and an image of their face. The image is about 50kb.  I want to display the details and the image on the PersonDetails.aspx page.  Currently I am putting the Image into a session variable.  I then set the asp:Image imageurl propery to another page and in that other page I write the Image from the session to the response stream.   My question is "Is this an acceptable way to do it or is there a better alternative?".   (No...

Web resources about - How to display a jpg image in Image Control - asp.net.web-forms

Samples of display typefaces - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Angelina Jolie displays extremely skinny frame on red carpet
ANGELINA Jolie has stunned fans with a rare red carpet appearance to promote her new film, Kung Fu Panda 3 .

Detectives set up 'murder display' in Melville
Detectives investigating the murder of a 70-year-old woman have set up a special display near her home in Melville.

Assfish goes on display at the Royal B.C. Museum in Victoria
The Royal B.C. Museum in Victoria has put on display a fish with a large head, small brain and unflattering name: a bony-eared assfish.

Report: Samsung to be Apple’s primary OLED display supplier as it invests up to $7.5B in readiness
Korea’s ET News claims that Samsung will become Apple’s primary supplier of OLED display panels, stating that an agreement has “practically been ...

U.S. Display Ad Spending to Overtake Search in 2016, Suggesting TV Budgets in Motion
... to follow, according to the latest estimates from eMarketer. This year for the first time, U.S. advertisers will spend more money on display ...

CES 2016: MSI’s Vortex Gaming PC on Display and It Looks Almost Like a Mac Pro
... is also similar to the Apple product, in that we have multiple Thunderbolt chips in play. These are combined with HDMI 2.0 to give three displays ...

iPhone 7 to feature flexible OLED display made by Samsung
Industry insiders are claiming that Samsung Display has agreed to a deal with Apple to make flexible OLED displays for the iPhone 7. Samsung ...

Gorgeous Galaxy S7 edge concept reimagines the curved display
... flagship smartphone series. Expected at MWC 2016, the Galaxy S7 will be available in at least two versions, including one with a curved display. ...

WestRock and T+ink Introduce Internet of Things Inventory Optimization Display Solution Working with ...
WestRock and T+ink today launched the first-ever merchandising display solution to incorporate printed electronic sensors in smart shelves and ...

Resources last updated: 1/19/2016 12:45:41 PM