Friday, 2 October 2015

Multiview + File Upload + UpdatePanel , selected file not upload to server

Leave a Comment
Recently I have developed some module to upload the file to server. In my code i have Update panel and also the multiview. Somehow the upload not working. So i though i was not set the full postback for upload process in the trigger section under update panel. But actually the full postback was set correctly. So i wonder, why the upload not work. Why server detected that no file submit to server.

So i start investigate my code, and luckily i found the solution.

The solution 

I just need to set enctype attribute at the form and value multipart/form-data .

This is the code i use.


   protected override void OnInit(EventArgs e)  
   {  
     base.OnInit(e);  
     Page.Form.Attributes.Add("enctype", "multipart/form-data");  
   }  

Hopefully this simple solution help someone.



By
NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)

0 comments:

Post a Comment

Subscribe to our newsletter to get the latest updates to your inbox.

Your email address is safe with us!




Founder of developersnote.com, love programming and help others people. Work as Software Developer. Graduated from UiTM and continue study in Software Engineering at UTMSpace. Follow him on Twitter , or Facebook or .



Powered by Blogger.