Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I saved Image in Image path and I display that in Gridview. My Problem is IN Grid view Edit button is their. When i will click edit button after I Retrive the image in Fileupload control, It is possible or any another way? . Image Not Update in Geidview . It is in upper side

Any One Help me ...

This is Save Code ... I need Update Code

C#
protected void Upload(object sender, EventArgs e)
{
    if (FileUpload1.HasFile)
    {
        string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
        FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Images/") + fileName);
        Response.Redirect(Request.Url.AbsoluteUri);
    }
}
Posted
Updated 7-Aug-14 19:21pm
v4
Comments
_Amy 30-Jul-14 11:54am    
What do you mean by "upper side"?
Sai Prasad anumolu 30-Jul-14 12:01pm    
I mean ... In Gird view When i click one Edit button This Saving path is goes to fileupload and After I will change another Image path ...Upper means Above (update button is their) ..when i click on Update Button ( I need Updation)

1 solution

C#
protected void Upload(object sender, EventArgs e)
{
    if (FileUpload1.HasFile)
    {
        string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
        FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Images/") + fileName);
        Response.Redirect(Request.Url.AbsoluteUri);
    }
else
{
//save ur file to a label on edit time.
//Then assign the data to here..
}
}
 
Share this answer
 

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