N
Nikolay Anestev
Hi all. In an ASP.NET application I want to make a DataGrid derrived class
named "MyDataGrid" which will encapsulate some common actions and then use
it in my pages instead of the DataGrid class.
When I rename the base class of any existing page member from:
public class MyPage : Page {
protected DataGrid DataGrid1;
..... }
, to:
public class MyPage : Page {
protected MyDataGrid DataGrid1;
..... }
a run-time error occurs:
Parser Error Message: The base class includes the field 'DataGrid1', but its
type (CSWebBankASP.MyDataGrid) is not compatible with the type of control
(System.Web.UI.WebControls.DataGrid).
So, I've added a "<%@ Register TagPrefix=uc2 Namespace=MyApp Assembly=MyApp
%>" directive at the top of the *.asp document and then changed the
"<aspataGrid>" tag to "<uc2:MyDataGrid>". In result this page works fine
already, but in the design view this DataGrid is not represented properly
( an error text occurs ) which tells me that there is something wrong in
this kind of technique.
So, does anyone have an idea how to do this without any errors? Just want to
tell you that using an UserControl doesn't work for me.
Thank you in advance. Best regards.
Nikolay Anestev
named "MyDataGrid" which will encapsulate some common actions and then use
it in my pages instead of the DataGrid class.
When I rename the base class of any existing page member from:
public class MyPage : Page {
protected DataGrid DataGrid1;
..... }
, to:
public class MyPage : Page {
protected MyDataGrid DataGrid1;
..... }
a run-time error occurs:
Parser Error Message: The base class includes the field 'DataGrid1', but its
type (CSWebBankASP.MyDataGrid) is not compatible with the type of control
(System.Web.UI.WebControls.DataGrid).
So, I've added a "<%@ Register TagPrefix=uc2 Namespace=MyApp Assembly=MyApp
%>" directive at the top of the *.asp document and then changed the
"<aspataGrid>" tag to "<uc2:MyDataGrid>". In result this page works fine
already, but in the design view this DataGrid is not represented properly
( an error text occurs ) which tells me that there is something wrong in
this kind of technique.
So, does anyone have an idea how to do this without any errors? Just want to
tell you that using an UserControl doesn't work for me.
Thank you in advance. Best regards.
Nikolay Anestev