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

How to solve this error?

3 Answers 535 Views
Grid
This is a migrated thread and some comments may be shown as answers.
grand lorie
Top achievements
Rank 1
grand lorie asked on 02 Mar 2010, 10:35 PM
Hi
I have a grid control on a page and wanted to use a different page (with data entry form) as user control for inserting and updating Data.
and i got this error, anyone can help..

Type 'ASP.addme_aspx' does not inherit from 'System.Web.UI.UserControl'.

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.Web.HttpException: Type 'ASP.addme_aspx' does not inherit from 'System.Web.UI.UserControl'.

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:

[HttpException (0x80004005): Type 'ASP.addme_aspx' does not inherit from 'System.Web.UI.UserControl'.]
   System.Web.UI.Util.CheckAssignableType(Type baseType, Type type) +8680560
   System.Web.UI.TemplateControl.LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, Object[] parameters) +75
   System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) +74
   System.Web.UI.TemplateControl.LoadControl(String virtualPath) +26
   Telerik.Web.UI.GridEditFormItem.InitializeUserControlForm(GridColumn[] columns, ControlCollection controls, GridEditFormSettings formSettings) +75
   Telerik.Web.UI.GridEditFormItem.InitializeEditForm(GridColumn[] columns) +3468
   Telerik.Web.UI.GridEditFormInsertItem.InitializeEditForm(GridColumn[] columns) +16
   Telerik.Web.UI.GridEditFormItem.Initialize(GridColumn[] columns) +227
   Telerik.Web.UI.GridEditFormItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +192
   Telerik.Web.UI.GridTableView.CreateInsertItem(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ControlCollection rows) +308
   Telerik.Web.UI.GridTableView.CreateTopInsertItem(Boolean useDataSource, GridEnumerableBase resolvedDataSource, GridTHead tHead) +50
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +988
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +495
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
   Telerik.Web.UI.GridTableView.PerformSelect() +4
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.GridTableView.DataBind() +221
   Telerik.Web.UI.GridTableView.Rebind() +48
   Telerik.Web.UI.GridTableView.InsertItem(IDictionary newValues) +147
   Telerik.Web.UI.GridTableView.InsertItem() +12
   Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +2710
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +134
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +38
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +115
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Mar 2010, 06:35 AM
Hi,

The error is caused due to the fact that you have assigned a page as the UserControlName in your EditFormSettings instead of a WebUserControl . A suggestion would be to use either the window editing approach  or make use of a User Control Edit Form  to contain the edit form .

Hope this helps.

Thanks,
Princy
0
grand lorie
Top achievements
Rank 1
answered on 04 Mar 2010, 08:51 PM
Hello Princy

Thanks a lot for your reply, i am using edit in template now (with the help of this video:
http://tv.telerik.com/aspnet/radgrid/radgrid-+-edit-templates)
and it is working fine except:

* The insert and update buttons as a beginner in asp.net i could not get it right to work with me in visual basic as he uses C# code on the tutorial.
(the code is to change the text from update to insert depends on the user choice).


* if i switch from editForm to popup everything work fine except the RadComboBox i can type in it and the matching choice appears but no drop down menu, i am not sure if i change the Zindex will help or not - it is 8000


any help will be appriciated
0
Princy
Top achievements
Rank 2
answered on 08 Mar 2010, 06:43 AM
Hi,

Please take a look at  the VB syntax for the Update/Insert buttons in the EditForm Template:

<asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'

Thanks,
Princy
Tags
Grid
Asked by
grand lorie
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
grand lorie
Top achievements
Rank 1
Share this question
or