Using the Page class

G

Guest

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
 
C

Cor Ligthert

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
 

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

Top