This is a migrated thread and some comments may be shown as answers.

WebformsMVP

4 Answers 93 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Adam Lindsay
Top achievements
Rank 1
Adam Lindsay asked on 08 Sep 2010, 08:13 PM
Do you have an example of Telerik controls with WebformsMVP ?

4 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 09 Sep 2010, 06:41 AM
Hi Adam,

You may check this code library, which illustrates a possible implementation of RadGrid and WebFormsMVP framework.

Kind regards,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Adam Lindsay
Top achievements
Rank 1
answered on 09 Sep 2010, 08:04 PM
I downloaded the app. It is not working. It is unable to load the entities.

Anyway, I am working on a new project with Telerik controls using WebformsMVP. I am getting below error.  Any idea how to fix this.


RegisterRequiresControlState can only be called before and during PreRender.


 

 

[InvalidOperationException: RegisterRequiresControlState can only be called before and during PreRender.]
   System.Web.UI.Page.RegisterRequiresControlState(Control control) +2766830
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +8901268
   System.Web.UI.ControlCollection.Add(Control child) +79
   Telerik.Web.UI.RadGrid.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +361
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +66
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.RadGrid.DataBind() +89
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   WebFormsMvp.Web.<>c__DisplayClassa`1.<Register>b__9(Object sender, EventArgs e) +39
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8872106
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2716

 

0
Adam Lindsay
Top achievements
Rank 1
answered on 09 Sep 2010, 08:30 PM

It is working if I remove client events. Any idea how to fix this ?

 

 

 

<ClientEvents OnGridCreated="rgEHProcessing_Created" OnRowDblClick="rgEHProcessing_RowDblClick"

 

 

 

OnCommand="rgEHProcessing_Command" />

 

0
Rosen
Telerik team
answered on 10 Sep 2010, 06:54 AM
Hi Adam,

I suspect that the cause for the error you are getting is the way MvpUserControl is implemented. As you may know the class exposes an AutoDataBind property, which by default will cause a call to DataBind on PreRenderComplete event. However, this will eventually recreate all databound controls too late in the page's lifecycle. Therefore, could you set AutoDataBind property to false (inside UserControl's constructor) and see if this makes any difference in the observed behavior.

Best wishes,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Documentation and Tutorials
Asked by
Adam Lindsay
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Adam Lindsay
Top achievements
Rank 1
Share this question
or