.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

image is not displaying in image control after selecting file from fileuploader control in c#asp.net

Posted By: shweta     Posted Date: August 07, 2010    Points:2   Category :ASP.Net
Hi All,
I have created a web page in my project in which I ahve added only 3 controls file uploader,button,image control.After selecting image file from file uploader and on clicking button image.imageurl doesnot show the image. While the same code is working nicely in other small project. My code is :

protected void Button1_Click(object sender, EventArgs e)
if (FileUpload1.HasFile)
string filename = System.IO.Path.GetFileName(FileUpload1.FileName);
FileUpload1.SaveAs(Server.MapPath("~/") + filename);

Image1.ImageUrl = filename;
catch (Exception ex)


plz let me know what is the problem in this code.Why image control is not showing image. Plz reply soon its very urgent.
Thanks & regards,

Author: Syed Shakeer Hussain             
Posted Date: August 07, 2010     Points: 5   

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend