Q: call a class in default page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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,
 
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!
***************************
 

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

Back
Top