Clemens Vasters: Enterprise Development & Alien Abductions
Thoughts about Microsoft .NET, Enterprise Services, XML and other dull and boring things.
Updated: 8/3/2002; 7:33:00 PM.

 














Subscribe to "Clemens Vasters: Enterprise Development & Alien Abductions" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Wednesday, July 31, 2002

Attribute-driven ASP.NET Session Management: The ultimate in style and beauty.

A couple of people seemed to like my attribute driven session management bits, so here's the completed solution for all of your session management desires when writing ASP.NET Web Forms. Cross-roundtrip, cross-page, cross-session, cross-site-visit, cross-page-visit. The XML code comments are the docs, take it, use it, improve it, keep me out of trouble, give credit and otherwise: write less code.

Attributes rock! Teaser:

  public class MyPage : StateManagingPage
    {
         [PersistentPageState] public int pageVisitsEver;
         [PersistentPageState("Visits")] public int siteVisitsEver;
         [SessionPageState] public int pageVisitsThisSession;
         [SessionPageState("Visits")] public int siteVisitsThisSession;
         [TransientPageState] public int roundtripsThisPage;
     
         // omissions...
         
         private void Page_Load(object sender, System.EventArgs e)
         {
                pageVisitsEver++;
                siteVisitsEver++;
                pageVisitsThisSession++;
                siteVisitsThisSession++;
                roundtripsThisPage++;            
         }    


11:38:11 PM      comment []

Water is 19 times more dangerous to kids than guns.
[GeekPress]

Interesting statistics. Whether you agree or disagree, it's worth noting that statistics -- along with the way they are interpreted and presented -- have an interesting effect on today's society. [Wrinkled Paper]

Exhibit A: The Hydrosphere is the layer of water which covers about 71% of the earth's surface. This layer is the combination of rivers, seas, lakes, underground water, and all the world's oceans. The average depth of the oceans is 3794 m (12,447 ft), more than five times the average height of the continents. The mass of the oceans is approximately 1.35 quintillion (1.35 × 10^18) metric tons, or about 1/4400 of the total mass of the earth. This is 0.04 % of the earth's mass.

Exhibit B: The number of small arms, ranging from pistols to shoulder-fired rocket launchers, in civilian and military hands around the world jumped about 16 percent to 639 million in 2001, a survey showed yesterday


6:02:06 PM      comment []

Happy Birthday, Ingo!  Today's my birthday. Birthday! I'm turning 23 today. I guess I'm one of the younger folks around here

I am 9 years and 364 days older than you.

 


1:59:44 PM      comment []


© Copyright 2002 Clemens Vasters.



Click here to visit the Radio UserLand website.

 


Send email to Clemens
July 2002
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
May   Aug

newtelligence
MSDN Regional Director