Hey Phil,
I've heard this scenario should be working by the time 2.0 releases.
The problem is App_Code compiles into an assembly that does not
reference any of the assemblies containing web forms (because those
assemblies all reference App_Code and we don't want circular
references).
I believe what the ASP.NET team plans to do is generate stub classes
in App_Code, you could do the same to work around the problem now.
A stub class would be a base class that your web form code behind
class derives from. That gives you a Type you can use from App_Code to
manipulate the web form.
Something else you might consider is defining an interface in App_Code
for one or more web forms to inherit. Give the interface properties
and methods that will be common to the form(s) you need to interact
with and do so through the interface type instead of the web form
class.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On 30 Jul 2005 06:33:20 -0700, "phil" <pb*****@gmail.com> wrote:
I recently tried converting my asp.net 1.1 app to 2.0 in visual studio
2005 beta 2.
I get several "type xxx is not defined" errors.
It seems that some of my code file within my web application can no
longer see the types defined in my asp.vb files.
Here is a simple example:
default2.aspx.vb
Partial Public Class Default2
Inherits System.Web.UI.Page
Public m_1 As Integer
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim testc As New Class1
testc.load(Me)
End Sub
End Class
class1.vb
Public Class Class1
Public Sub load(ByVal p As Default2)
' ???
End Sub
End Class
class1.vb is in the App_Code directory.
the error is reported for class1.vb is:
Type "Default2" is not defined
why can't class1 see the type defined in the aspx.vb file?
something obvious i am sure, but i remain confused.