Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The base class includes
the field 'dgPager', but its type (System.Web.UI.WebControls.DataGridPagerStyle) is not compatible with the type of control (ASP.DataGridPager_ascx). Line 92:
Line 93:
When you put a control in an ASPX file, a corresponding field whose name is the same as the control's ID is automatically created in the generated class. So the generated class has two fields with the same name and different types, which is illegal. You need
to change the name either of the control, or of the DataGridPagerStyle. -- Ryan Milligan
I had similar issue. The issue fixed by changing 'CodeFile' tag to 'CodeBehind' tag in the ascx file. I guess this affects how .net compiles the app and hence was throwing error.
I had the same message with a user control inheriting from a generic class.
The base class includes the field 'uxContactDetailsView', but its type (ClassName`1[[Namespace.GenericType, AssemblyNamePrefix.AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]) is not compatible with the type of control (ASP.contactdetailsview_ascx)
The "ClassName`1[[blahblahblah, blah, blah, blah]]" is how to declare the generic type in the Inherits attribute of the <%Control Language = "C#" ... > tag - apparently it doesn't understand the C# "ClassName<MyGenericType>" syntax, and needs to use the
CLR syntax ("ClassName`1[[MyGenericType]]")
Turns out the user control wasn't in a namespace (so it assumed I wanted to use "ASP" as the namespace?) - and giving this class file a namespace solved the problem.
So the user control .ascx file now starts with <% Control Language = "C#" Inherits = "MyNamespace.MyType`1[[MyGenericNameSpace.MyGenericType, MyDll, Version=1.0.0.0., Culture=null, PublicKeyToken=null]]" CodeBehind = "MyCodeFile.ascx.cs" %>
kuponutcom
Member
575 Points
163 Posts
base class field is not compatible with type of control
Sep 13, 2003 07:50 AM|LINK
Line 93:
Ryan Milligan
Participant
1057 Points
210 Posts
Re: base class field is not compatible with type of control
Sep 13, 2003 03:26 PM|LINK
dotnetpost
Member
2 Points
1 Post
Re: base class field is not compatible with type of control
Feb 20, 2008 02:08 AM|LINK
I had similar issue. The issue fixed by changing 'CodeFile' tag to 'CodeBehind' tag in the ascx file. I guess this affects how .net compiles the app and hence was throwing error.
Will129
Member
2 Points
1 Post
Re: base class field is not compatible with type of control
Nov 05, 2008 04:05 PM|LINK
I had the same message with a user control inheriting from a generic class.
The base class includes the field 'uxContactDetailsView', but its type (ClassName`1[[Namespace.GenericType, AssemblyNamePrefix.AssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]) is not compatible with the type of control (ASP.contactdetailsview_ascx)
The "ClassName`1[[blahblahblah, blah, blah, blah]]" is how to declare the generic type in the Inherits attribute of the <%Control Language = "C#" ... > tag - apparently it doesn't understand the C# "ClassName<MyGenericType>" syntax, and needs to use the CLR syntax ("ClassName`1[[MyGenericType]]")
Turns out the user control wasn't in a namespace (so it assumed I wanted to use "ASP" as the namespace?) - and giving this class file a namespace solved the problem.
So the user control .ascx file now starts with <% Control Language = "C#" Inherits = "MyNamespace.MyType`1[[MyGenericNameSpace.MyGenericType, MyDll, Version=1.0.0.0., Culture=null, PublicKeyToken=null]]" CodeBehind = "MyCodeFile.ascx.cs" %>