Paul Wilson's .NET Blog

Ramblings from the Creator of WilsonDotNet.com

  • Changing ASP.NET Forms Authorization Redirection

    ASP.NET makes it easy to configure Forms Authentication and Authorization, including automatically redirecting you to the login page when necessary.  The problem is that it also redirects authenticated users to the login page when they attempt to access pages that they are not authorized to access.  This gives you the opportunity to login as someone else, and then be automatically redirected back to the page you originally attempted to access.  But that may not be the behavior you want for authenticated users -- do your users really have multiple logins and do they understand why they end up back at the login page?  Instead, I want my authenticated users to be redirected to some other page that tells them they do not have access, and possibly gives them a way to contact an administrator.  So here's the code that you need to put in your Global.asax file:

  • What Exactly is the Point of O/R Mappers ?

    I had a recent email exchange with someone that was observing that they still had to be at least somewhat aware of the workings of the O/R Mapper and their database design when they designed their entity classes.  “To me, this is too intrusive since I have to incorporate a lot of persistence knowledge into my design whilst I'm still designing rather than being able to play around with the design and then add on the persistence.”  This actually made me think a lot of Andrew Conrad's blog postings, as well as a lot of conversations I've had with some of my architect, developer, and DBA friends over the last couple of years.

  • House For Sale in Woodstock (Georgia)

    Anyone want to buy a nice 6-1/2 year old 3-bedroom 2-1/2 bath house with a huge front porch and a drive-under basement with 2 finished bonus rooms in a good size culdesac lot in Woodstock (Georgia) ?  I realize the answer on a technical blog that goes around the world is probably no -- but its worth a shot -- you never know.  They finally released one of the lots that we've been eyeing to build a bigger house, with a dedicated home office for my new independent life, so we'll be getting our current house on the market very soon.

  • Thanks to Contributors of WilsonORMapper v2.1

    I want to give a very special thanks to several of my subscribers for their contributions to the just released WilsonORMapper Version 2.1:

    1) David D'Amico and Craig Tucker improved the ORHelper to automatically handle 1-to-many and many-to-1 relations, as well as adding default null-values.  These changes to the ORHelper, which I don't usually try to improve since its just a help tool, are definitely going to be a significant assistance.

    2) Jerry Shea add support for composite (multiple column) keys, enumerated member types, and an improvement to the ObjectHolder's InnerObject.  The composite key capability may not apply to many users, but its huge for those that were needing this support.

    3) Ken Muse added the GetObjectCount method, for getting record counts.

    Thanks to everyone, Paul Wilson

  • Going Independent Finally

    I'm saying goodbye to permanent employment and hello to Wilson Software Consulting. That's right, I've given my 2 weeks notice and started incorporating as an S-Corp. Risky?  Not at the moment, since I've already found an exclusive full-time client. Actually, they found me through my site and the other online activities that I do! They've got a lot to do, so I'm not looking for more clients, at least no time soon, although its nice to get my own corp setup, since you never really know the future. Did I also say I'll be working from home?  That was definitely the clencher for me, as that saves me from at least 1 1/2 hours of Atlanta traffic everyday, if not more. And I really look forward to having a little more flexibility with my family time, and just in time for summer -- oops, my allergies will keep me indoors regardless.

  • MasterPages in .NET v1.* -- Dynamic Masters

    It seems that lately my implementation of MasterPages for .NET v1.* is getting a lot of hits again, which is kind of funny considering its been out for over a year.  Anyhow, one of the questions that I get asked a lot is how to dynamically change the master template at runtime, which is obviously possible since I do it on my own site.  The solution to this problem all comes down to timing -- the Init event is already too late, so you need something earlier, like the AddParsedSubObject override.  Just be aware that this method is called for every root object added to the page, so make sure that you wrap any code you add to this method so that it only gets ran once.  So here's the code:

  • Matrix Spoof featuring Gates and Ballmer

    The MVP Summit featured a cool spoof of the Matrix featuring Bill Gates as Morpheus and Steve Ballmer as Neo.  Everyone wanted a copy of it, but we were told they didn't have the rights to give it to us.  Apparently it was also featured at Comdex last year, and here's a lot of pictures from it and half of the video.

  • Visual Source Safe, MVP Summit, and NDA Info

    So I got to ask at the MVP Summit today when MS was going to actually ship a workable source control system.  Now they make a big deal about how we are under NDA, but I'm going to tell you anyhow.  The answer was . . . (drum-roll) . . . they're know it sucks and they're working on it.  Hmmm -- I've heard that answer many times in very public settings -- so why have an NDA Q&A if the answers aren't anything new?