Nate1
April 4th, 2008, 06:43 PM
If I create a base class for my pages which will open my Database connection, load user data etc. Can I also define commonly used imports files in this class, when I do this currently it doesn't reference them
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.SqlClient
Imports database ' Class that would be used by child page
Public Class BasePage
Inherits System.Web.UI.Page
Private _Conn As SqlConnection
Public ReadOnly Property Conn() As SqlConnection
Get
If _Conn Is Nothing Then
_Conn = Utility.GetConnection
End If
Return _Conn
End Get
End Property
End Class
Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.SqlClient
Imports database ' Class that would be used by child page
Public Class BasePage
Inherits System.Web.UI.Page
Private _Conn As SqlConnection
Public ReadOnly Property Conn() As SqlConnection
Get
If _Conn Is Nothing Then
_Conn = Utility.GetConnection
End If
Return _Conn
End Get
End Property
End Class