Hi,
1. check whether the proctection level of the declared variables is at
least Protected.
At least protected - in fact I never change these (I've found
changing it to public is never a good idea because it changes it back to
protected sometimes!) - so I use public properties to get references outside
the page.
2. This problem may also occur if you manually delete the control from the
code behind file and do some operation and again paste the declaration so
in this case, just check whether you have proper event handler in the
InitializeComponent() method.
This doesn't apply. This happens to a number of controls - some of
which haven't been touched in months.
If still you face the problem then please give some more details, like the
exact Page attribute that you are having in your aspx page.
Whether you are creating control by dragging them from the toolbox or you
are adding them in code.
and at what point of time you are getting this error.
The error occurs at compile time - it's a build error i.e.
"DataGrid1 is not defined"
Here is the control attribute : Control Language="vb"
AutoEventWireup="false" Codebehind="RelTypesList.ascx.vb"
Inherits="iirfnew.RelTypesList"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"
Here is an example of a problem control:
Public Class RelTypesList
Inherits GlobalLeague.UI.EntryEditControls.InLineListBase
Implements GlobalLeague.UI.EntryEditControls.ISetupObject
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents RelTypeAdd1 As RelTypeAdd
Protected WithEvents AddEditPanel1 As System.Web.UI.WebControls.Panel
Protected WithEvents AddNewButton1 As
iirfnew.GlobalLeague.UI.EntryEditControls.AddNewBu tton
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region