Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
serialization a fileupload
Hazel Mahmud
May 11 2015 9:24 PM
579
Reply
i have a problem where my fileupload gave an error as below image. how do i fix it.. i attach my code as well below. please someone help me. My session state is InProc.
aspx.cs code :
if (Session["FileUploadPerjanjian"] == null && FileUploadPerjanjian.HasFile)
{
Session["FileUploadPerjanjian"] = FileUploadPerjanjian;
lblperjanjian.Text = FileUploadPerjanjian.FileName;
}
//// Next time submit and Session has values but FileUpload is Blank
//// Return the values from session to FileUpload
else if (Session["FileUploadPerjanjian"] != null && (!FileUploadPerjanjian.HasFile))
{
FileUploadPerjanjian = (FileUpload)Session["FileUploadPerjanjian"];
lblperjanjian.Text = FileUploadPerjanjian.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 (FileUploadPerjanjian.HasFile)
{
Session["FileUploadPerjanjian"] = FileUploadPerjanjian;
lblperjanjian.Text = FileUploadPerjanjian.FileName;
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
populating other columns of gridview based on first column
how to focus mdi parent form control when i close child form