Inherit Base Page Class

T

tshad

I have a Base Page Class that I built am just starting to use.

In my aspx page I have:

<%@ Page Language="VB" trace="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" Inherits="MyFunctions.Page" %>

I also have a dll that I call in my Page_load as:

Sub Page_Load(s as Object, e as EventArgs) if not IsPostBack then
PageInit.PageSetup(Page) if IsRefresh then ... end if

My problem is I want to call my refresh routine which is a base class. I
need to call my IsRefresh function from this dll

How do I set up the following routine to recognize the new Page class (the
inherited one). I am passing the Page as Page class.


Imports System Imports System.Web Imports System.IO Imports System.Web.UI
Imports System.Web.UI.WebControls Imports System.Web.SessionState Imports
System.Data Imports System.Data.SqlClient Imports System.Web.HttpCookie
Imports System.Web.HttpCookieCollection Imports System.Web.HttpResponse
Imports System.Web.HttpRequest imports System.Web.HttpContext Imports
System.Web.HttpApplication Imports System.Web.HttpApplicationState Imports
System.Collections Imports Microsoft.VisualBasic NameSpace MyFunctions
Public Class PageInit Public Shared sub PageSetup (thePage as Page)
if IsRefresh ... end if End Sub End Class End
Namespace

Thanks,

Tom
 
T

tshad

KJ said:
Can you post a little more code; it seems like what you posted isn't
enough to go on.
Sorry,

The code got messed up.

I redid it and posted it below.

I finally figured out what I did wrong.

This is the page that I am passing to my .dll, not the normal
System.Web.UI.Page.

PageInit.PageSetup(Page)

In PageInit.PageSetup I was calling the above IsRefresh property and was
getting an error that I didn't have an Object Reference.

I had PageSetup defined as:

Public Shared sub PageSetup (thePage as Page)

and was calling IsRefresh as:

If IsRefresh ...

What I needed to do was have it set as:

Public Shared sub PageSetup (thePage as MyFunctions.Page)
and
If thePage.IsRefresh

That solved it.

Thanks,

Tom

Old post.
*****************************************************
I have a Base Page Class that I built am just starting to use.

In my aspx page I have:

<%@ Page Language="VB" trace="true" ContentType="text/html"
ResponseEncoding="iso-8859-1" Inherits="MyFunctions.Page" %>

I also have a dll that I call in my Page_load as:

Sub Page_Load(s as Object, e as EventArgs)
if not IsPostBack then
PageInit.PageSetup(Page)
if IsRefresh then
...
end if

My problem is I want to call my refresh routine which is a base class. I
need to call my IsRefresh function from this dll

How do I set up the following routine to recognize the new Page class (the
inherited one). I am passing the Page as Page class.


Imports System
Imports System.Web
Imports System.IO
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.SessionState
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.HttpCookie
Imports System.Web.HttpCookieCollection
Imports System.Web.HttpResponse
Imports System.Web.HttpRequest
imports System.Web.HttpContext
Imports System.Web.HttpApplication
Imports System.Web.HttpApplicationState
Imports System.Collections
Imports Microsoft.VisualBasic

NameSpace MyFunctions

Public Class PageInit

Public Shared sub PageSetup (thePage as Page)
if IsRefresh
...
end if
End Sub
End Class
End Namespace
****************************************************
 

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

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top