Click here to Skip to main content
15,893,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a fileupload column in my aspform along with several other controls like textbox, dropdownlist etc. I have a save button. Whenever I click save all the data will be saved in sql database. And also I have the option for editing the saved data. So whenever I click edit I am able to fetch all the values whichever I entered in the textbox, dropdown list etc. But I am not able to fetch the value for this fileupload control. Can anybody help with this problem?

Thanks.
Posted
Updated 7-Apr-11 2:23am
v2

File upload will not take that value. If you have a path or a value put it in a hidden field and next time while you are saving the data take the value from the hidden field.
 
Share this answer
 
v2
Comments
Sandeep Mewara 7-Apr-11 8:32am    
1. PRE tags are for formatting code
2. Please avoid text-speak.

Rest, great going. Keep it up.
But I am not able to fetch the value for this fileupload control
No you cannot get.
Use a Label control to show the uploaded file name.
 
Share this answer
 
You can not get it because file uploder can not instantiate.
To solve this you can take a lable to disply the path from your database/from other source.
 
Share this answer
 
if (FileUpLoad1.HasFile)
{
FileUpLoad1.SaveAs(@"C:\temp\" + FileUpLoad1.FileName);
Label1.Text = "File Uploaded: " + FileUpLoad1.FileName ;
}
else
{
Label1.Text = "No File Uploaded.";
}
}

try this one
 
Share this answer
 
v2
Comments
Toniyo Jackson 7-Apr-11 8:43am    
Added pre tag for code
try this Link

Click[^]
 
Share this answer
 
Ok thanks for the info anv napster.
 
Share this answer
 
Thanks all for the information.
 
Share this answer
 
Comments
m@dhu 7-Apr-11 8:55am    
Always use Add Comment link to reply instead of adding as new solution.

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