After post back File upload Control not holding the files
After postback fileupload control is not holding the files. i have checked with/without update panel. session using but it is also not displaying the files. plz help.
Know the answer? Post it. Somebody with the same question will find it here.
Imtiyaz AnsariRank #1,031 · 1.9K reputationPosted Apr 4, 2016, 9:40 PM EDT
//If first time page is submitted and we have file in FileUpload control but not in session// Store the values to SEssion Object
{
Session["FileUpload1"] = FileUpload1;
Label1.Text = FileUpload1.FileName;
}
// Next time submit and Session has values but FileUpload is Blank
else if (Session["FileUpload1"] != null && (! FileUpload1.HasFile))
{
FileUpload1 = (FileUpload) Session["FileUpload1"];
Label1.Text = FileUpload1.FileName;
}
// Now there could be another sictution when Session has File but user want to change the file
// In this case we have to change the file in session object
else if (FileUpload1.HasFile)
{
Session["FileUpload1"] = FileUpload1;
Label1.Text = FileUpload1.FileName;
}
bijay Behera168 reputationPosted Apr 4, 2016, 10:24 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts