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

Using the Page class

Hi,
For my application I am planning to build a base class for all my webforms,
this class will be called SitePages.cs. Within this class there will be
methods to retrieve page details from the database, page security, some site
specific error handling and methods to retrieve content for the page from the
database.
My question is, can I use the Page class as a "base" class for my SitePages
class and how do I call/use methods defined in Page.cs within the code
behind classes of my webforms.
(Bit of a newbie question I know)
Thanks
Jul 21 '05 #1
1 1131
MicroMoth,

The answer is simple. Keep in mind that a webform page is stateless, that
means that it completly initialize everything again when it is posted back.

You can use static C# or shared VBNet classes. However those exist for the
application which means all users from who the sessions are still active. So
it is not something as a winform where you can keep information.

That does not mean that you cannot use those static/shared classes, but than
you should from every variable make a seperated one for every user (with the
session or a cookie). In my opinion is that a hell of a job.

However when you have information that is for all users, by instance a
static pricelist, companyinformation or something, than the static/shared
classes can maybe help you.

I hope this give some idea's

Cor

"MicroMoth" <st***********@forvus.co.uk>
Hi,
For my application I am planning to build a base class for all my
webforms,
this class will be called SitePages.cs. Within this class there will be
methods to retrieve page details from the database, page security, some
site
specific error handling and methods to retrieve content for the page from
the
database.
My question is, can I use the Page class as a "base" class for my
SitePages
class and how do I call/use methods defined in Page.cs within the code
behind classes of my webforms.
(Bit of a newbie question I know)
Thanks

Jul 21 '05 #2

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

Similar topics

1
by: Stephen Adam | last post by:
Hi there, I've just started a c# project at work where I cannot use Visual Studio. I am trying to pass variables from one form to another. When I try to create an instance of the sending class...
4
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than...
3
by: nevets2001uk | last post by:
Hi. I've just started my second ASP.NET (VB) app and I'm using codebehind this time. I'm not using visual studio but am instead coding it all in notepad (HTML, ASP.NET and CSS) I'm trying to...
13
by: Bijoy Naick | last post by:
My project contains multiple aspx pages. Many of these pages have code-behind that use several helper functions. Instead of copying each helper function into each aspx page, I am thinking of...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
15
by: Joe Fallon | last post by:
I would like to know how you can figure out how much memory a given instance of a class is using. For example, if I load a collection class with 10 items it might use 1KB, and if I load it with...
8
by: acb | last post by:
Hi, I wrote a DLL Component (using Visual Studio 2005) and managed to include it into a C# Console application. I am now trying to include this component into a Web project. I copy the DLL...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
4
by: rn5a | last post by:
Using VBC, I compiled a VB class file into a DLL named MyPro.dll. The namespace used in this class file is 'MyPro' & the public class is named 'MyClass'. This is the ASPX page which imports the...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.