display image in image box as soon as i browse image

Posted by Aparna Bhise under ASP.NET AJAX on 5/16/2011 | Points: 10 | Views : 7552 | Status : [Member] | Replies : 2
Hi,

i m using asp.net in that i want to display image in image control when i click on file uplooad dialog box ok button.

Thanks and Regards,

Aparna Bhise



Responses

Posted by: Karthikanbarasan on: 5/16/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Aparna,

Pls post your requirement clearly... so that we can help u out...

Thanks
Karthik
www.f5Debug.net

Aparna Bhise, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: 23rasika on: 5/16/2011 [Member] Starter | Points: 25

Up
0
Down
Bellowed code enable you to browse file from any location on ur machine, save it in ur application folder, ur image control will display respected image.
e.g. pic.jpg

if (FileUpload1.HasFile)
{
string FileNm = Path.GetFileName(FileUpload1.FileName);
//FileNm=pic.jpg
FileUpload1.SaveAs(@"C:\test\site1\" + FileNm);
Image1.ImageUrl = FileNm;
}

Above code working fine, if you hav doubts, plz let me know.

Thnx,
Rasika M

Aparna Bhise, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response