Re: Sporadic Viewstate errors

  •  05-15-2013, 12:10 PM

    Re: Sporadic Viewstate errors

    Hi jk121960,

     

    Just list the large file upload settings below, please check it and ensure that you have set all of them correct. 

     

    1. maxRequestLength in web.config

     

     <httpRuntime maxRequestLength="value"/> 

     

    2. maxAllowedContentLength in IIS

     

    Edit the request filtering feature settings and the request limits using IIS manager

    1. )Open IIS Manager.
    2. Select the website that you want to configure.
    3. Make sure you are in Features View per the button at the bottom of the manager.
    4. Select Requests Filtering and open it by double-clicking the icon. The Request Filtering pane displays.
    5. From the Actions pane on the right hand side of the screen click Edit Feature Settings... link. The Edit Request Filtering Settings window displays.
    6. In the Request Limits section, enter the appropriate Maximum allowed content length (Bytes) and then click the OK button.
    7. Restart IIS.

     

    3. Do not set property "MaxSizeKB" for the uploader control. 

     

    4. Set property "TempDirectory" for the uploader control. This property needs to set in the controller and the handler both and set to the same value.

     

    Create an folder under your site root and set it for property "TempDirectory". 

     

    controller code

     

    using (CuteWebUI.MvcUploader uploader = new CuteWebUI.MvcUploader(System.Web.HttpContext.Current))
                {
             uploader.TempDirectory = "~/myTemp";
    }
     
    Handler code
     
    public override void OnUploaderInit(MvcUploader uploader)
        {
             //change photo to your folder name
            uploader.TempDirectory ="~/myTemp";
        }
     
     
    If you have set all of them and still get problem, then please show me all the values what you set for, so I can check it too.
     
    Regards,

     

    Ken 

View Complete Thread