System.Web.UI.Page inheritance problem

J

Jure Leskovec

Hi!

I tried to insert a layer between web form class and System.Web.UI.Page.
So I made my own HTMLPage class, wich is derived from System.Web.UI.Page and
web form is derived from HTMLPage class

Everything is OK, except Session object isn't available (All other asp
objects are: Response, Request, Application).
If webform class is derived directly from System.Web.UI.Page, it works fine.

If someone knows the truth, I would be grateful.


- Jure




There's my HTMLPage class code:

' HTML class
Public Class HTMLPage
Inherits System.Web.UI.Page

Sub New()
MyBase.New()


Connection = New
System.Data.OleDb.OleDbConnection(CONNECTION_STRING)
Connection.Open()
End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'Code to Log to file or database could go here
End Sub

Function CreateATB(ByVal Name As String) As String
CreateATB = "<INPUT type=""text"" id=""atb_" & Name & """
runat=""server"">"
End Function
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top