Click here to Skip to main content
15,921,959 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
XML
<form id="form1" runat="server">
   <div>
   </div>
   <asp:FileUpload ID="FileUpload1" runat="server" />
   <br />
   <asp:Image ID="Image1" runat="server" Height="153px" Width="223px" />
   <br />
   <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
   <br />
   <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
   </form>





When i click on BUTTON, Image Tag should display image..
Posted
Comments
#realJSOP 29-Dec-10 7:45am    
What's the question?

Here before I found couple of things like this but many of those are not supported by all browsers(I mean without saving image in server you can't make preview in all browsers).

But I found this which is supported one.

On file upload image preview in asp.net[^] (It has 2 ways - With/Without save image in server)
 
Share this answer
 
Dear Vineet,

On Button click event write the following code:
Image1.ImageUrl=FileUpload1.PostedFile.FileName;


I hope it will help you.

Regards!
Aman
 
Share this answer
 
Comments
Hiren solanki 29-Dec-10 8:01am    
comment from OP : how can i do this ???
i mean i want that when i click on my button, my image should be display just as preview ...... .. image is being browse using file upload...
Hiren solanki 29-Dec-10 8:02am    
It's an ASP.NET and image will be displayed once operation is completed. He want at time operation starts ? am I right Vineet ?
Vineet_2109 29-Dec-10 8:08am    
its very simple ordinary question.. its like preview my image..
"select image from computer in browse tag. then click on BUTTON.. so image would be previewed in image tag..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900