I like page inheritance. I use that for persistancy of data accross pages
etc and sometimes for consistency of UI.
However a simple class within same namespace would work similarly ( and more
efficiently ) as the classic asp include files. 

-----Original Message-----
From: T. Bradley Dean [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 5:06 PM
To: dotnet
Subject: RE: Create my own library of functions


For the current site I'm working on, I did it by creating a user control
that inherits System.Web.UI.Page. Then, when I add a new web form I have
it inherit the user control (named "PageTemplate") instead of
System.Web.UI.Page.

Not only does PageTemplate have all my functions, but it also has code
to check for my logon cookie, redirect to / if the user is in an admin
area of the site, but is not an administrator, and it loads the HTML for
the page UI.

It's worked out great, I like it much more then includes in ASP.

~Brad 

-----Original Message-----
From: Gerald de Bueger [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 03, 2002 10:27 AM
To: dotnet
Subject: Create my own library of functions


Hi all,

I'm new to .net and want to learn how to do stuff I did in asp in
ASP.Net

In classic asp, I include huge file at the top of each page. Those files
contain usefull functions. For instance, I've got a function called
isNullOrEmpty. So in the page I can just say: if isNullOrEmpty(sValue)
then .... 
What would be the best way to do that in .net. I'd like to access the
function directly without having to declare it first. Like if it was a
c# intinsec function as toString() for instance. In other words, is
there a way to get the same functionnality as an include but in a more
powerfull maner?

Thanks for your help. I hope I was clear enough.

Gerald

---
You are currently subscribed to dotnet as: [EMAIL PROTECTED] To
unsubscribe send a blank email to
%%email.unsub%%

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search Subscription
Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/




---
You are currently subscribed to dotnet as: [EMAIL PROTECTED]
To unsubscribe send a blank email to %%email.unsub%%

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/


---
You are currently subscribed to dotnet as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/


Reply via email to