473,434 Members | 1,462 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,434 software developers and data experts.

Q: call a class in default page

Hello,
Once I add a web form it creates a class that inherits from
System.Web.UI.Page, I have many pages and I want to create a class in my
default page which has a method that display a message for example and I want
to call this method in all pages. I am new in this concept, how should I do
this?
Thanks,

Nov 19 '05 #1
1 902
Create a "page" that inherits from the page Class. PUt the code common to all
pages in that class. WHen you add new pages, have them inherit from the class
in question, rather than the Page class.

If you simply want common functions, you can create a class with static
(VB.NET = Shared) methods that can be called from each class. It is not
automatic, but it is easier to work with in some ways.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"JIM.H." wrote:
Hello,
Once I add a web form it creates a class that inherits from
System.Web.UI.Page, I have many pages and I want to create a class in my
default page which has a method that display a message for example and I want
to call this method in all pages. I am new in this concept, how should I do
this?
Thanks,

Nov 19 '05 #2

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

Similar topics

8
by: trying_to_learn | last post by:
Why do we need to explicitly call the copy constructor and the operator = , for base class and member objects in composition? ....book says "You must explicitly call the GameBoard copy-constructor...
4
by: dale zhang | last post by:
Hi, I have the following private function in one page: private string Connect() { string sConnect; // this value could go directly in the Global.asax.vb declarations switch...
5
by: ozie | last post by:
Hi , I am new to ASP.NET. I was reading about Page class in one of the ASP.NET books and am confused with the way the Page class is actually implemented.What is didnt understand in when is this...
13
by: Duron | last post by:
I created a new folder using VS.NET 2003. Then I created a new web form under that folder, say, \Member\Default.aspx. However, even if I didn't do anything to that page, a run-time error appears...
6
by: grist2mill | last post by:
I want to create a standard tool bar that appears on all pages that is a control. The toolbar has a button 'New'. What I wolud like when the user clicks on 'New' depends on the page they are on. I...
2
by: Alani | last post by:
Hello All, I'm a new ASP.NET programmer and I want to create a custom control consist of two properties (Number1) and (Number2) and both of them are integers and default value = 0, now I'm...
2
by: Darren.Ratcliffe | last post by:
Hi If I have functionX in my master page, how would I call the function from my .aspx page that has the master page assigned to it? Many thanks Darren
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.