display image in a image image button



i have to display an image in image button while uploading


Image1.ImageUrl = Upload.PostedFile.FileName; is not working


7/14/2008 10:15:52 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 19


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.



Reza Nassabeh

Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
7/14/2008 10:29:45 AM

 Upload.PostedFile.FileName will give you only posted file name. you need to save it in server and then only you can refer the image path as a imageUrl.

thnks n regards,

7/14/2008 10:40:47 AM
look these links http://www.codeproject.com/KB/aspnet/netimageupload.aspx http://www.stardeveloper.com/articles/display.html?article=2003022601&page=1
7/14/2008 10:43:02 AM

Image1.ImageUrl = Upload.PostedFile.FileName; is not working

try this :

using System.IO;

Image1.ImageUrl = "http://localhost/ApplicationName/"+Path.GetFileName(myFile.FileName);


Image1.ImageUrl ="~/image1.jpg"


Image1.ImageUrl = "http://localhost/ApplicationName/"+Upload.PostedFile.FileName;


7/14/2008 11:55:08 AM

Similar Artilces:

Image not displayed in image button
Hi all, I created a custom web control imagebutton and I had set the  imageurl  for imagebutton. See the code in default.aspx:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><%@ Register Assembly="WebControlLibrary1" Namespace="WebControlLibrary1" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/199...

Displaying image in image button
Yes, I am obviously a loser. I have an image button, and have an image. I put the image in the same directory as the form that i am running, and simplyreferred to the image by its name: imageURL="P107005.JPG" But, the image doesn't show. I also attempted to refer to the image by its hardcoded directory placement, but have proven to be a failure at that, too: imageURL="//localhost/csASPServerControlBasics2_P105/P107005.JPG" Anyone tell me what I am screwing up? ~Mike dude check if using this path is correct. imageURL="//l...

Image in image
Hi, I have a project where clients viewing my website can buy t-shirts. They can choose from a number of t-shirt colors and shapes which are their plain colour. They can also choose a number of prints to be placed on the t-shirt. These will be graphics stored in a database. My problem is on how I can displaty the t-shirt with the graphics or logo they chose on te t-shirt. It would be something like drawing text on an image but instead drawing an existing image on the base image. Any Ideas? (I am using visual studio 2005 and vb.NET)   RegardsMerovingian you 1. You can create a...

Image on Image
I am trying to display a page that has image of a map on it. The user can then place other images of red thumbtacks on the image at different locations. Then when these thumb tacks are clicked on, they open a folder of pics related to the area. I saw a method in the imageButton class that returns the (x,y) of the location where the user clicked. I thought I could use this information to place another, smaller image button, on that area. My problem is that i can't seem to get the bottom imageButton to be transparent so I can see the smaller one. Am i on the right track with this. Any advi...

Imaging, but not imaging
We multicasted to 43 machines. Updated the image on the master. Multicasted the updated image to 36 machines. (the other 7 wouldn't join the session for some unknown reason). I visually verified that all 36 were imaging. One of the 8 which didn't rename appears to not even have been imaged. The problems with the previous image were still there. It's as though the machine didn't image even though I saw it take part in the session and the temp bar going across the screen. What the heck's going on here? AlaN As a try, what happens if you boot either to PXE ...

image and image
// create an image object, using the filename we just retrieved System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(file)); // create the actual thumbnail imageSystem.Drawing.Image thumbnailImage = image.GetThumbnailImage(64, 64, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);   now my question is how to display this image in my image1 control in asp.net (version 1.1) the below line of code is not working.  Image1.ImageUrl=thumbnailImage.ToString();Mark As Answer If my reply helped you. Hi, you can save t...

Display image from image
Let me explain more. I have a Gridview, that displays an image.  Then i have a detailsview displaying an image from the selected value in the gridview.  Simple.  When i click on one of the images from the gridview, it displays the correct image in the detailsview.  Basically, i have two images in each row of the table in the database.The only way this works is if i have "autogenerateselectbutton=true" set.  I do not want the select link next to my image.  I want to be able to pick on the image in the GridView, and have it show the correct image in...

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

Save Image Path into Database, Retrieve Image Path by Particular Image ID and Display Image through Gridview
Hi All, Currently, I have a file upload control in my aspx page to allow user to upload images. When the user clicks the SAVE button, the image will be saved in a particular folder named 'PMap' that located within the website. What I am trying to do here is to direct all uploaded images into a common image folder (in this case 'PMap') and then, retrieve the images and displayed it through a Gridview according to its respective image id. I have managed to store all uploaded images into a common image folder, PMap. However, I hope advice can be given on my following pro...

Displaying images in a DW (Getting image dimensions)
PB9.0 Hi all. Can some one help me with the following please: - I want to display an image in a dw. The user types the path and name of the file to be displayed in a text box. I then need to display this in the image object in the DW (this I can do), the problem is the image is being distorted based on the sixe of the image object. How do I get the dimensions of the actual image (could be a bmp, gif or jpg file) so I can set the image object size just prior to loading ? Thanks You could purchase a 3rd party DLL that has functionality to read the file's dimensions. A chea...

Getting images from db and displaying in WebControls.Image
So I have the following code which is getting my image, but unfortantly all that is displayed is a 'x' where the Image controls is placed.  In the main aspx.cs page:1 //get the image in bytes from the database 2 byte[] imageInBytes = image.LoadImage(Convert.ToInt32(dr.ItemArray[3])); 3 4 //place in memory stream 5 System.IO.MemoryStream memoryStream = new MemoryStream(imageInBytes, 0, ...

function to display text on image button(image)
i have an image button with an image in my design page. how to get text on the image.text is not displayed.plz can any one help on this   joynee :i have an image button with an image in my design page. how to get text on the image.text is not displayed.plz can any one help on thisI'm a bit confused about what you are trying to achieve.. can you please elaborate more? Regards,Vinz"Code, Beer and Music" that's my way of being a programmer!How to get your Forum Question Answered | Blog | CodeASP.NET i have asp:image button with an image in my page.when i try t...

Image Button Not Displaying Image Set At Runtime
I am wondering why this only shows a box with 3 shapes in it instead of the image I'm pointing to? Note that imgMyImage is an image button control added at design time.strMyImageFile = Server.MapPath("~") & "\App_Data\myimages\MyImage.gif") imgMyImage.ImageUrl = strMyImageFile I have already added the folder 'myimages' to the App_Data directory using the Add Folder in the right pop-up menu, and the file is there as well. So theoretically, it should work. However, all I get is a small box in it's place, and in the small box are shapes (circle, square, etc.) as if the image wasn't found....

display image button image in new page
I am using vb and sql 2005.  I have a formview with image buttons. The images are stored in a folder on the server, and the image paths are stored in a database. When I click the image button ...I would like to open the full size image in a new page. Can Someone help me out with this. THank you. Create a page that will stream an image to the client (perhaps with the filename being passed through as a querystring). You can then open this page by using the javascript window.open method, or by setting the target property on a hyperlink to "_blank".Website Design Darlington...

Web resources about - display image in a image image button - asp.net.getting-started

Comparison of display technology - Wikipedia, the free encyclopedia
CRTs use an electron beam, scanning the display, flashing a lit image. If interlacing is used, a single full-resolution image results in two ...

Pioneer upgrades its lineup of aftermarket CarPlay displays
... featuring Apple CarPlay and Siri Eyes Free. Pioneer first brought Apple’s CarPlay infotainment system to cars through aftermarket displays in ...

Dell Demonstrates 30-inch 4K OLED Display
Dell does not produce its own display panels, but when it comes to unique “world’s first” monitors, it is sometimes years ahead of all of its ...

Aston Martin Rapide puts the future on display at CES
... Aston Martin and its Chinese infotainment partner Letv came to Las Vegas for CES this year with a Rapide S packed with oversized displays and ...

The future of TV, virtual reality on display
HDR TVs offer "better pixels" than 4K, while virtual reality becomes all the rage at Vegas tech show

Withings Go Is An Affordable Activity Tracker Rocking An E-Ink Display
... seen so few other companies go that route. That might change this year, as Withings has announced Go, a new fitness tracker with an e Ink display ...

The Skreens app puts all of your HDMI signals on one display
... device at CES Showstoppers. The self-titled gadget allows users to spread the video content from up to four HDMI inputs across a single display. ...

Thandie Newton Gets Apology From Starbucks After Tweeting About Offensive Display
Thandie Newton Gets Apology From Starbucks After Tweeting About Offensive Display

Go Sell Your Kidneys, Dell Has a 4K 30-Inch OLED Display
2016 might be the year of VR headsets and all, but some people still enjoy looking at regular screens. And the 30-inch, pro-level 4K OLED display ...

Leaked 'iPhone 7' Display Backlight Shows Moved 3D Touch and Flex Cables
Taiwanese website Apple.club.tw has shared leaked images of the purported backlight assembly for the " iPhone 7 " display. The component draws ...

Resources last updated: 1/8/2016 7:41:42 PM