locked
Report Viewer error message - "ASP.NET ViewState has been disabled..." RRS feed

  • Question

  • User694481106 posted
    I've created a new page with a ReportViewer control on it. When the page loads, I'm getting the following error:

    "ASP.NET ViewState has been disabled. The Report Viewer control requires that ViewState be enabled."

    I've set ViewState = true for the entire page and each control, to no avail.

    Any ideas? Why would the ViewState become disabled when this page loads? Maybe something to do with security and the ReportViewer control?

    Thanks!
    Matt
    Friday, May 26, 2006 11:06 AM

All replies

  • User-35431450 posted
    I experienced the same problem. My problem was related to the master page that I am using, the view state on my master page was set to false. It works fine after I enabled it.
    Monday, June 5, 2006 12:56 PM
  • User467754049 posted
    Could you fix that problem.
    How ca n i change the viewState to true in my master page???

    thanks
    Wednesday, June 7, 2006 7:48 PM
  • User-35431450 posted
    In my master page, I change the "Enable View State" of my content place holder to true. This resolves the problem I have.


    Thursday, June 8, 2006 12:49 PM
  • User-2124071134 posted
    Be carefull to encapsulate your  control in a <form> tag ...

    That was my mistake.
    By default enableview state is true.
    Thursday, July 20, 2006 8:54 AM
  • User1300917695 posted

    Also, don't forget to add <TT>runat="server"</TT> ( <TT><form runat="server"></TT> )

    It took me a couple minutes before I smacked my forehead and realized I'd forgotten that little piece.

     

    Friday, February 29, 2008 4:26 PM
  • User-269404413 posted

    Hi to all,

    try to add the code like this

    <form id="form1" runat="server">

    <table cellpadding="0" cellspacing="1" width="100%" border="0" >

    <tr>

    <td >

     

    <rsweb:ReportViewer ID="rvPurchase" runat="server" Height="416px" Width="946px"

    EnableViewState="True">

    </rsweb:ReportViewer>

    </td>

    </tr>

    </table>

    </form>

    Hope this will help.

    Tuesday, September 23, 2008 10:28 AM
  • User1078915448 posted

    This error is weired. I had the same problem and now I fixed it and figured it out that if there is report viewer without html codes, than this error ocurred. Put you report viewer control inside html code like below.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div align="left">
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
        Font-Size="8pt" Height="530px" Width="795px" 
            onreportrefresh="ReportViewer1_ReportRefresh">
        <LocalReport ReportPath="Reports\Report1.rdlc">
        </LocalReport>
    </rsweb:ReportViewer>
    </div>
    </form>
    </body>
    </html>
    Monday, April 18, 2011 3:55 PM