I'm sure this will be frowned upon, but I simply always include the same code-behind
page for every aspx in my application. Even subdirectories. Even though visual studio
complains that it can't find the code-behind page, when .NET runs the page it finds it
fine since it looks based on namespaces as opposed to directories. I compile all my
utility functions into a big class called functions, pretty creative huh. Then in the
code behind page for every aspx page I instantiate a function object called aFunction.
Now I can access any of my functions (which are compiled and quick) from my aspx page
by using aFunction.doSomething("") ... It has proven to be quite nice. If you did not
want to use the code behind you could instantiate the objects in a global ASP but I
prefer the way I'm doing it since the code behind page turns into an object manager of
sorts. My environment now seldom requires much effort. I simply create .aspx pages and
mix & match functions for the specific functionality. Every page ends with including a
file called template.aspx which decides the best template file for the page and
displays the output. I hate reinventing the wheel, so I don't. Most pages in my
applications are only a few lines long and very few of those lines are dedicated to
presentation. So the layout is like this:
Part Location
---------------------------------------------
global functions C# Class(es)
page initialization code-behind(C#)
specific business logic aspx (C#)
presentation html/aspx templates
global functions handle the data interfaces. The methodology came from an application
system I wrote in PHP, the legacy and some smaller recent apps run in PHP while much
of the new development is in .NET, but believe it or not, the retrofit has proven
itself smooth, seamless, and transparent. Except for some of the short comings of the
current framework, which I'm certain will be cleared up.
<>< Ryan
-----Original Message-----
From: Gerald de Bueger [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 11: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 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/