none
RegisterRequiresViewStateEncryption() RRS feed

  • Pergunta

  • Boa tarde, 

       Ao executar uma pagina que contem um gridview dentro de um formview aparece o seguinte erro: Tem como me ajudarem? Obrigado.

    The RegisterRequiresViewStateEncryption() method needs to be called before or during Page_PreRender.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.InvalidOperationException: The RegisterRequiresViewStateEncryption() method needs to be called before or during Page_PreRender.

    Source Error: 
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 
    [InvalidOperationException: The RegisterRequiresViewStateEncryption() method needs to be called before or during Page_PreRender.]
       System.Web.UI.Page.RegisterRequiresViewStateEncryption() +97
       System.Web.UI.WebControls.GridView.OnInit(EventArgs e) +124
       System.Web.UI.Control.InitRecursive(Control namingContainer) +569
       System.Web.UI.Control.InitRecursive(Control namingContainer) +302
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +395
       System.Web.UI.ControlCollection.Add(Control child) +358
       System.Web.UI.WebControls.CellControlCollection.Add(Control child) +58
       System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +50
       System.Web.UI.WebControls.CellControlCollection.AddAt(Int32 index, Control child) +61
       System.Web.UI.WebControls.TableCellCollection.AddAt(Int32 index, TableCell cell) +59
       System.Web.UI.WebControls.TableCellCollection.Add(TableCell cell) +40
       System.Web.UI.WebControls.FormView.InitializeRow(FormViewRow row) +591
       System.Web.UI.WebControls.FormView.CreateRow(Int32 itemIndex, DataControlRowType rowType, DataControlRowState rowState, TableRowCollection rows, PagedDataSource pagedDataSource) +132
       System.Web.UI.WebControls.FormView.CreateDataRowFromTemplates(Boolean dataBinding, TableRowCollection rows) +144
       System.Web.UI.WebControls.FormView.CreateDataRow(Boolean dataBinding, TableRowCollection rows, Object dataItem) +151
       System.Web.UI.WebControls.FormView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2910
       System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +101
       System.Web.UI.WebControls.FormView.PerformDataBinding(IEnumerable data) +36
       System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +197
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +114
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +225
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +127
       System.Web.UI.WebControls.FormView.DataBind() +28
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +108
       System.Web.UI.WebControls.FormView.EnsureDataBound() +254
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +130
       System.Web.UI.Control.EnsureChildControls() +162
       System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +66
       System.Web.UI.Control.FindControl(String id) +41
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +248
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +318
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +318
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +318
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +318
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +318
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +318
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +318
       Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root) +318
       Telerik.Web.ChildControlHelper.FindControlRecursive(Control searcher, String ID) +362
       Telerik.Web.UI.RadAjaxControl.FindControlRecursive(String ID) +37
       Telerik.Web.UI.RadAjaxManager.ResolveClientID(String ID) +73
       Telerik.Web.UI.AjaxSetting.SerializeToJavascript(RadAjaxManager manager) +121
       Telerik.Web.UI.AjaxSettingsCollection.SerializeToJavascript(RadAjaxManager manager) +242
       Telerik.Web.UI.RadAjaxManager.GetScriptDescriptors() +187
       System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +511
       System.Web.UI.ScriptManager.RegisterScriptDescriptors(IScriptControl scriptControl) +50
       Telerik.Web.UI.RadAjaxManager.Render(HtmlTextWriter writer) +219
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +94
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +343
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +63
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +269
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +54
       System.Web.UI.Control.Render(HtmlTextWriter writer) +39
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +94
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +343
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +63
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +269
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +54
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +286
       System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +52
       System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +378
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +94
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +343
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +63
       System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +69
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +269
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +54
       System.Web.UI.Control.Render(HtmlTextWriter writer) +39
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +94
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +343
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +63
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +269
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +54
       System.Web.UI.Control.Render(HtmlTextWriter writer) +39
       System.Web.UI.Page.Render(HtmlTextWriter writer) +49
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +94
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +343
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +63
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6008
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
    quarta-feira, 23 de maio de 2012 20:06

Respostas