473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Inherit Base Page Class

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
Aug 30 '06 #1
2 1667
KJ
Can you post a little more code; it seems like what you posted isn't
enough to go on.

tshad wrote:
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
Aug 30 '06 #2
"KJ" <n_**********@mail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
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
************************************************** **
Aug 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jeff | last post by:
Greetings I am beginning a web app. I am using C# aspx forms for my web pages. Is it possible to create/use one aspx file as a base from which to derive other aspx files? I can not get this to...
15
by: Ben Mann | last post by:
Hi there, I am starting on an ASP .Net project. I have some examples of using a base class for pages to inherit from to allow additional properties to be used by default. This seems like a good...
0
by: Janaka | last post by:
I'm using Web Matrix and a custom built DLL which I've placed in my /bin directory for my website on a Windows 2003 server. I'm using the same setup which worked previously on Windows 2000. Any...
2
by: Christopher Attard | last post by:
Hi, I have some repeated code in the Page_Load() methods in several asp.net pages. This common code performs some checking and is not related to HTML. I tried to create a Base asp.net page...
4
by: David | last post by:
I have trying to have a webform inherit controls from another form and can't get it to work Say I have a form that saves the person's demographic info. ****one.aspx**** //I have an object...
7
by: Frank | last post by:
Hi, a question probably asked before, but I can't find the answers. Base class X, classes A, B and C inherit class X. In class A I do not want to inherit property (or function or method) P1....
2
by: LeAnne | last post by:
I've created a custom Page class (which in turn inehrts from Page class). This class has some generic code which i'd like to include into every page. At the moment, I keep modifying the pages and...
13
by: learning | last post by:
Hi I have a static class written by other team which encapsulates a database instance. but I need to extend it to incldue other things. I know that C# static class is sealed and can;t be inherited...
2
by: Joe | last post by:
Is it possible to inherit from a UserControl? If I try my user control class is not recognized. Thanks, Joe
3
by: Hillbilly | last post by:
I just deployed using FTP to send .aspx and .cs files alike and discovered the base class I use with Master Pages is apparently causing problems --unidentified at the moment-- but a test page that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.