im working on a asp.net 3.5 app. i am trying to reference a public class in another class, but the IDE can’t find it. In .net 4.0 you can set the namespace of the website. i think i just need to add the namespace reference to point to the public class i’m trying to reference, but can’t figure out what the “root” or “base” namespace is (or where to set it) in 3.5
public class user control:
Public Class dashboard_controls_registration
Inherits System.Web.UI.UserControl
End Class
My Business Object:
Namespace BusinessLayer
Public Class BusinessObject
Public Function MakeControl() as String
Dim ctl As dashboard_controls_registration = DirectCast(pageHolder.LoadControl("/controls/registration.ascx"), UserControl)
End Function
End Class
End Namespace
In the “MakeControl” function in the businesslayer.businessobject im trying to reference the control (a public class):
However, IDE is throwing an error that it’s undefined. I would assume because it’s not in the same namespace?
I would think that if i referenced the “dashboard_controls_registration” class with it’s namespace it would work.. ie:
Dim ctl As namespace.dashboard_controls_registration = DirectCast(pageHolder.LoadControl("/controls/registration.ascx"), UserControl)
but I can’t find a way in 3.5 to define the “root” namespace of the project. IN 4.0 I use this exact code and it works fine.
Thoughts?
Thanks!
I did not set this project up as a web application. Once I did that, it worked fine.