# Saturday, March 1, 2008

My son's basketball season ended Friday night in the District Finals.  The game couldn't have been closer.  Jackson High led by 9 points late in the game when Pioneer came storming back to force overtime.  But, in the end Jackson won in the extra session to capture the District crown.  Pioneer ended its season at 22-1 - a great record by any standard.  But Friday night all the boys were focused on the 1 loss.

The next day, Nick was back in the gym working on his jump shot.  I'm already excited about next year.

Saturday, March 1, 2008 7:29:03 PM (GMT Standard Time, UTC+00:00)
# Saturday, February 23, 2008

I delivered the web security presentation yesterday for my customer.  This is the same presentation I delivered as part of the DevCares event last week.  It went much better due to the fact that I secured a much better laptop for the presentation.  

The presentation materials are available here.

Saturday, February 23, 2008 2:30:46 PM (GMT Standard Time, UTC+00:00)
# Thursday, February 21, 2008

Scott Mitchell has an excellent article on 4GuysFromRolla.com about how to use ASP.Net to prompt a user to save changes before leaving a page.  It is part of a series he wrote back in 2004 but it is still relevant today.  The only change you should make today is that he calls methods of the Page class (IsStartupScriptRegistered, RegisterClientScriptBlock, RegisterArrayDeclaration) and these methods are depcrecated and replaced by the same methods in the Page.ClientScript class.

Scott's code initializes a client-side array with a list of inputs to monitor and the initial value of each input.  He then uses the onbeforeunload event to check if the data in any of these inputs has changed and displays a confirmation prompt if any data hase changed.  This event fires even if the user attempts to exit the form by closing the browser or clicking the brower's 'Back' button.

I liked Scott's approach so much that I took his public methods and moved them into a base class that inherits from System.Web.UI.Page and I inherit all my web pages from this class.  Now in each Page_Load, I can call methods of the base class to register controls that, if changed, will mark page data as dirty and prompt the user when he attempts to navigate away without saving.

I noticed that the "initial state" of controls were reset whenever a postback occurred, so I created a method "MarkDataAsDirty" that could be called when a control's "autopostback" fired but when the user is not finished entering data.  This sets a hidden form on the client that is checked in the onbeforeunload method to determine if data has changed.

I also made the methods public so they could be accessible to any user controls dropped on a page.  And I created the utility method RegisterForConfirmUnsavedChanges that registers the most common controls on the page using Scott's original methods.

I've included a sample ASP.NET web site in which every page inherits from a base page and methods of that base class are called to implement this functionality.


ConfirmSaveSite1.zip (9.51 KB)
Thursday, February 21, 2008 4:15:33 PM (GMT Standard Time, UTC+00:00)

Tonight's lunar eclipse was impressive.  I think I saw a full lunar eclipse when I was a boy but I don't remember it well.  This time I saw the moon with the full shadow of the Earth upon its face.  As I had heard, the light around the Earth's atmosphere cast a blood-led glow on the moon, giving it an eerie quality.  I managed a couple of photos despite not having a handy tripod.


Photo by David Giard


Thursday, February 21, 2008 3:18:54 AM (GMT Standard Time, UTC+00:00)
# Wednesday, February 20, 2008

My son's high school basketball team won again tonight.  In the first half, they were thoroughly outplayed and trailed by as many as 24 points.  But they chipped away at the lead and ended up winning by 4.  It was a big win, not because they beat a good team (they did) but becuase it was the last game of the year and they finished the season 20-0.  It was the first undefeated team at his school in 35 years.

The state tournament starts Monday in Dexter. 

Nick and Dave

You can view photos of the final game (along with a kick-ass soundtrack) below.

Wednesday, February 20, 2008 3:27:42 AM (GMT Standard Time, UTC+00:00)
# Sunday, February 17, 2008

The DevCares event went pretty well.  Over 40 people attended.  I didn't have a decent laptop to use and I ended up borrowing one from a friend but it was not nearly powerful enough to run all the demos on the Virtual PC.  This detracted from the presentation.

I will be delivering this same presentation for my customer next Friday and I have already requested better hardware.     

I got some help from Mike Wood, who delivered this presentation the week before in Cincinnati.

You can view the materials at www.davidgiard.com/DevCares.


Sunday, February 17, 2008 4:47:16 PM (GMT Standard Time, UTC+00:00)
# Thursday, February 14, 2008

I'll be speaking at the Microsoft DevCares even tomorrow afternoon in Southfiled, MI.

The topics are:

  • Securing your web site from hackers
  • Microsoft Visual Studio Tools for Office.

There is still time to register at http://www.devcares.com


Thursday, February 14, 2008 4:45:15 PM (GMT Standard Time, UTC+00:00)
# Sunday, January 13, 2008

I spent Thursday and Friday at CodeMash in Sandusky, OH.  Quick Solutions (my employer) is a major sponsor of this event that features speakers and developers from both the .Net and the Java community.  Quick strongly encouraged me to attend but I didn't need any convincing. 

The sessions were great.  Jeff Blankenburg's demos on Silverlight and Scot Hanselman's Friday keynote address stand out in particular for me.

But I think I got more benefit from the fact that I was able to meet so many other people in the developer community here in the midwest.  I've been traveling so much the last few years that I don't really know that many local people.  I met more developers from Michigan these 2 days than I met during the 4 years I've lived here. 

I also had a chance to mingle with the other folks from Quick Solutions, which is a rare treat.  Although I work for Quick, I live a couple hundred miles from their office in Columbus, so my interaction with them is limited.

The conference was held at the Kalahari Resort, which features a huge indoor water park.  There wasn't much time to enjoy the park during the conference, but some attendees brought their families who splashed around while their spouse did the geek thing.  I promised my 13-year-old son that he could meet me on Friday night with a friend and go to the park.  Unfortunately his ride fell through so I ended up driving back to Michigan Friday night and returning to Ohio Saturday morning to take the boys to the park for the day.  We had a blast!

You can view photos of the conferece here and see a musical slideshow of the photos below

Sunday, January 13, 2008 8:56:53 PM (GMT Standard Time, UTC+00:00)