simshp
asked on
Get fileupload filename from edittemplate in listview
How would I get the Filename of a FileUpload control which is in an edittemplate of a listview ... I need to store the value in a db. The listview is populated with a sqldatasource, which handles all the selection and updating, so I am not sure how to capture its value on the listview update (how to bind it to datasource) ...
I have tried what I have attached, but not working.
Thanks you
I have tried what I have attached, but not working.
Thanks you
protected void ImageListings_OnUpdating(object sender, SqlDataSourceCommandEventArgs e)
{
FileUpload FileToUpload = (lvImages.FindControl("ImageEditFile") as FileUpload);
if (FileToUpload.HasFile)
{
e.Command.Parameters["@image"].Value = FileToUpload.FileName;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER