Archive for January, 2008

p1180026-small.jpg

We interrupt your regular schedule programming to introduce…

P1180026_SMALL

P1180029

Name: Keira Cheyenne Davis
Born:  1/18/2008 @ 10:42am
Size:   4lbs. 10oz. 18 in.

Wow! Isn’t she beautiful!

organizeusings.png

New Feature: Organize using statements with VS 2008

Wow!  I will be using ( no pun intended ) this feature quite often!

 

OrganizeUsings

 

I’ve seen some VS macros that currently do this in VS 2005 and I think Visual Studio IDE enhancement tools like Resharper, has this feature already baked into their product. However, in VS 2008, we get this for free, at least if you are using C#. Until next time…

 

Happy Coding!

 

kick it on DotNetKicks.com

Strongly-Typed Session Properties in ASP.NET

I recently was given the opportunity to comment on a blog post which discussed a method of using Strongly-Types Session Properties with ASP.NET. After reading it, I noticed that the implementation was quite similar to something I have been using for months now. I was able to provide some feedback on how his implementation differed from mine. Anyway’s, the link below will take you to the blog post which I am referring to and you could decide for yourself.

UPDATE: 1/11/2008

For those who would like to see my implementation here it is:

   1:  using System;
   2:   
   3:  using System.Web;
   4:   
   5:  [Serializable]
   6:   
   7:  public sealed class SessionManager {
   8:   
   9:     private const string SESSION_MANAGER = "SESSION_MANAGER";
  10:   
  11:     private Product _product = null;
  12:   
  13:     private SessionManager( ) {
  14:   
  15:     }
  16:   
  17:     public static SessionManager Current {
  18:   
  19:         get {
  20:   
  21:             HttpContext context = HttpContext.Current;
  22:   
  23:             SessionManager manager =
  24:   
  25:                 context.Session[ SESSION_MANAGER ] as SessionManager;
  26:   
  27:             if ( manager == null ) {
  28:   
  29:                 manager = new SessionManager( );
  30:   
  31:                 context.Session[ SESSION_MANAGER ] = manager;
  32:   
  33:             }
  34:   
  35:             return manager;
  36:   
  37:         }
  38:   
  39:     }
  40:   
  41:     public Product ActiveProduct {
  42:   
  43:         get {
  44:   
  45:             return this._product;
  46:   
  47:         }
  48:   
  49:         set {
  50:   
  51:             this._product = value;
  52:   
  53:         }
  54:   
  55:     }
  56:   
  57:  }
  58:   
  59:  //And to access this property
  60:  SessionManager.Current.ActiveProduct = new Product();

 

If you would like to see what others have implemented, see the article below:

Strongly-Typed Session in ASP.NET – Chris Stewart’s ASP.NET Blog

Until next time…

 

Happy Coding!

 

kick it on DotNetKicks.com

Ctrl-S in web.config in Visual Studio 2008 closes web.config file

Finally! Someone found a fix and root cause for this nagging bug I’ve been encountering with VS2008. You can find everything you need here. Thanks Rick! 

Until next time…

 

Happy Coding!