D
Daniel Manes
Okay, here are the facts ma'am (or mister):
1. I have a user control called "Header" and a main page called
"ReportMatch".
2. I've written "code-behinds" for both the user control and the main
page.
3. This means four files: Ladder.ascx, Ladder.ascx.vb,
ReportMatch.aspx, and ReportMatch.aspx.vb.
4. None of this stuff is precompiled, and I would prefer not to have to
mess with precompiling and dll's and all that jazz (and I don't have
VS.NET).
5. I have Option Strict turned on.
6. I can get the Header to show up in ReportMatch (yay!), but if I try
to declare a variable in the ReportMatch code-behind as type Header, I
get the error "BC30002: Type 'Header' is not defined" (boo!).
So, my question:
Is there any way to get this error to stop occurring? Please tell me
there is. I'm going crazy here!
Here are some code snippets (all in VB.NET):
********** from Ladder.ascx **********
<%@ Control Language="VB" Explicit="True" Strict="True" Debug="True"
Src="Ladder.ascx.vb" %>
<table> ... some links ... </table>
********** from Ladder.ascx.vb **********
Option Explicit
Option Strict
Imports System, System.Configuration, System.Data, System.Data.Odbc,
System.Web.UI, System.Web.UI.WebControls
Public Class Header
Inherits UserControl
Public LogInLink As HyperLink
'A few more declarations like this -- snipped
Sub InitConnectObj
Dim ConnectStr As String
ConnectStr = ConfigurationSettings.AppSettings("ConnectStr")
ConnectObjG.ConnectionString = ConnectStr
End Sub
'Another method -- snipped
End Class
********** from ReportMatch.ascx **********
<%@ Page Language="VB" Explicit="True" Strict="True" Debug="True"
Src="ReportMatch.aspx.vb" %>
<%@ Register TagPrefix="Ladder" TagName="Header" Src="Ladder.ascx" %>
<html><head> ... </head>
<body><form runat="server">
<Ladder:Header ID="HeaderCtrl" runat="server" />
<table> ... some stuff ... </table>
.... some custom validator tags ...
</form></body></html>
********** from ReportMatch.ascx.vb **********
Option Explicit
Option Strict
Imports Microsoft.VisualBasic, System, System.Configuration,
System.Collections, System.Data, System.Data.Odbc, System.Math,
System.Web.UI, System.Web.UI.WebControls
Public Class ReportMatch
Inherits Page
Public HeaderCtrl As Header = CType(LoadControl("Ladder.ascx.vb"),
Header) 'This generates the error "BC30002: Type 'Header' is not
defined"!!!
Public DateCtrl As Calendar
'A few more declarations like this -- snipped
Sub Page_Load(Sender As Object, E As EventArgs)
HeaderCtrl.InitConnectObj() 'If I try to declare HeaderCtrl As Type
Control or UserControl, this doesn't work because InitConnectObj is not
a method of either of those classes.
'Some other stuff -- snipped
End Sub
'Several methods and validation handlers -- snipped
End Class
I've scoured this newsgroup and Google and tried seemingly everything
(except precompiling into dll's, which I hope I don't have to do), and
I just can't get this thing working.
Thanks in advance! (or TIA! if you prefer your thank you's in acronym
form)
-Dan
1. I have a user control called "Header" and a main page called
"ReportMatch".
2. I've written "code-behinds" for both the user control and the main
page.
3. This means four files: Ladder.ascx, Ladder.ascx.vb,
ReportMatch.aspx, and ReportMatch.aspx.vb.
4. None of this stuff is precompiled, and I would prefer not to have to
mess with precompiling and dll's and all that jazz (and I don't have
VS.NET).
5. I have Option Strict turned on.
6. I can get the Header to show up in ReportMatch (yay!), but if I try
to declare a variable in the ReportMatch code-behind as type Header, I
get the error "BC30002: Type 'Header' is not defined" (boo!).
So, my question:
Is there any way to get this error to stop occurring? Please tell me
there is. I'm going crazy here!
Here are some code snippets (all in VB.NET):
********** from Ladder.ascx **********
<%@ Control Language="VB" Explicit="True" Strict="True" Debug="True"
Src="Ladder.ascx.vb" %>
<table> ... some links ... </table>
********** from Ladder.ascx.vb **********
Option Explicit
Option Strict
Imports System, System.Configuration, System.Data, System.Data.Odbc,
System.Web.UI, System.Web.UI.WebControls
Public Class Header
Inherits UserControl
Public LogInLink As HyperLink
'A few more declarations like this -- snipped
Sub InitConnectObj
Dim ConnectStr As String
ConnectStr = ConfigurationSettings.AppSettings("ConnectStr")
ConnectObjG.ConnectionString = ConnectStr
End Sub
'Another method -- snipped
End Class
********** from ReportMatch.ascx **********
<%@ Page Language="VB" Explicit="True" Strict="True" Debug="True"
Src="ReportMatch.aspx.vb" %>
<%@ Register TagPrefix="Ladder" TagName="Header" Src="Ladder.ascx" %>
<html><head> ... </head>
<body><form runat="server">
<Ladder:Header ID="HeaderCtrl" runat="server" />
<table> ... some stuff ... </table>
.... some custom validator tags ...
</form></body></html>
********** from ReportMatch.ascx.vb **********
Option Explicit
Option Strict
Imports Microsoft.VisualBasic, System, System.Configuration,
System.Collections, System.Data, System.Data.Odbc, System.Math,
System.Web.UI, System.Web.UI.WebControls
Public Class ReportMatch
Inherits Page
Public HeaderCtrl As Header = CType(LoadControl("Ladder.ascx.vb"),
Header) 'This generates the error "BC30002: Type 'Header' is not
defined"!!!
Public DateCtrl As Calendar
'A few more declarations like this -- snipped
Sub Page_Load(Sender As Object, E As EventArgs)
HeaderCtrl.InitConnectObj() 'If I try to declare HeaderCtrl As Type
Control or UserControl, this doesn't work because InitConnectObj is not
a method of either of those classes.
'Some other stuff -- snipped
End Sub
'Several methods and validation handlers -- snipped
End Class
I've scoured this newsgroup and Google and tried seemingly everything
(except precompiling into dll's, which I hope I don't have to do), and
I just can't get this thing working.
Thanks in advance! (or TIA! if you prefer your thank you's in acronym
form)
-Dan