Here is the situation. VS.NET 2003 VB.NET XP Pro (.Net 1.1) I have a file1.aspx file that has Datagrid on it. I have the aspx codebehind file1.aspx.vb. I have a DatagridClass.vb in another folder. The file1.aspx.vb file does not have the standard DataGrid_Update,
DataGrid_Delete subs in it. DataGridClass.vb has the subs for the DataGrid in file1.aspx. When I try to run the page it says 'DataGrid_Edit' is not a member of 'file1.aspx.vb'. I have used the Import command (Imports Project.DataGrid) in the file1.aspx.vb
but that doesn't work. In the DataGrid.vb file I use the Protected WithEvents DataGrid as System.Web.UI.WebControls.DataGrid to access the functions of the DataGrid class. What am I doing wrong? If I posted this code it would be a bunch of code. Thanks for
all your help, MLogan
If an answer has been provided to you question please mark it as an answer.
From the way you describe this, you're trying to separate out the event handling code for the datagrid into another file? This isn't quite the way to go about it. One way to do it would be to make your datagrid into a UserControl, put all the Datagrid event
handlers in the code-behind for the user control, then just include the whole user control on the page. I suspect it would be posssible to wire up the handlers in your DatagridClass.vb as delegates for the grid's events, but this is so different than how anyone
else is working with grids that you will find yourself in increasingly uncharted waters where it will be hard for others to help you.
Mlogan
Contributor
2466 Points
490 Posts
Functions cannot be accessed (BC30456: 'DataGrid_Edit' is not a member of 'CLASSNAME'.
Aug 28, 2003 06:13 PM|LINK
JimRoss [MVP...
Star
10080 Points
2008 Posts
Re: Functions cannot be accessed (BC30456: 'DataGrid_Edit' is not a member of 'CLASSNAME'.
Aug 28, 2003 08:25 PM|LINK
MS MVP ASP.NET [VC++/MFC emeritus]
Old Dog Learns New Tricks
Preferred programming language: cuneiform on clay tablets