For uploading the image file in asp.net website write following code.
////////////////////////////// CODE ////////////////////////////////
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string path = Server.MapPath(FileUpload1.PostedFile.FileName);
FileUpload1.SaveAs(path);
Image1.ImageUrl = FileUpload1.PostedFile.FileName;
/*****************************************************
// if you want to store it in any specific folder the
*****************************************************/
//string path = Server.MapPath("Photo/") + FileUpload1.PostedFile.FileName;
//FileUpload1.SaveAs(path);
//Image1.ImageUrl = "~/Photo/" + FileUpload1.PostedFile.FileName;
}
////////////////////////////////////////////////////////////////
Download Code : UpaloadImage.rar
***************************************************************
See Also :
--
/\/ir@\/ <(.'.)>
////////////////////////////// CODE ////////////////////////////////
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
string path = Server.MapPath(FileUpload1.PostedFile.FileName);
FileUpload1.SaveAs(path);
Image1.ImageUrl = FileUpload1.PostedFile.FileName;
/*****************************************************
// if you want to store it in any specific folder the
*****************************************************/
//string path = Server.MapPath("Photo/") + FileUpload1.PostedFile.FileName;
//FileUpload1.SaveAs(path);
//Image1.ImageUrl = "~/Photo/" + FileUpload1.PostedFile.FileName;
}
////////////////////////////////////////////////////////////////
Download Code : UpaloadImage.rar
***************************************************************
See Also :
- Android Installation for beginners_Part-1
- Android Installation for beginners
- How to Resize a Partition in Windows 7 or Vista
- How to customize send to menu.
- How to change Folder background in windows 7
--
/\/ir@\/ <(.'.)>
0 comments:
Post a Comment
Thanks for comment