Thursday, December 20, 2007

If anyone is curious, this is what Big Sky Amber Ale looks like before partaking. Be warned, this is a hoppy beer!
Posted by Picasa

Tuesday, December 18, 2007

Debug symbols not loaded

I spent a frustrating hour yesterday trying to figure out why I couldn’t hit the breakpoints (“Debug symbols not loaded”) in my class library.  I added and removed references and build options until I could think of nothing else to do.  Then I said, even though it’s not pointing at the GAC version (this is a DLL shared by multiple apps), let’s see what happens when I remove it from the GAC…BINGO, problem solved!  I still don’t understand why it was using the GAC version since all the projects in my solution were referencing each other as “project references”, but that solved the issue.

Thursday, December 13, 2007

MasterPage tips

It pays to look around at what other developers are doing. Today I was reading SimpleTalk articles (see Phil Factor) and found the Master Pages Tips and Tricks: Specifically, I do not need to cast the Master page to be able to use my custom properties.
Fortunately, a strongly-typed solution is available that doesn't involve casting the Master property to the base class of the master page in order to access its members (keep in mind that any server controls defined in the master page won't be accessible even after a cast is performed, because they're marked as protected by default).
In cases where a control defined in a master page needs to be exposed to one or more content pages in a strongly-typed manner, a public property with a get block can be added into the master page class as shown in Figure 2. The get block returns a Label control instance named lblHeader.

A content page can reference members defined in the custom master page class by adding the MasterType directive immediately under the Page directive:

<%@ MasterType VirtualPath="~/Templates/WebsiteMasterPage.master" %>
This causes the ASP.NET compiler to use the custom master page class for the type of the Page class's Master property as opposed to the default MasterPage class

Word to Help Converter

I found a great little open source tool for converting Word documents to compiled HTML help files written by tonibo. It also generates a reasonably good HTML frames based help system – the purpose for which I am using it.  Rather than create a single large PDF file, I prefer to have a series of help files that can be consumed as a guide, or link directly to from the content.  If you download the source, you also get to brush up on your Spanish!  Mui Bien!


Tuesday, December 11, 2007

First beer - first impressions

For those awaiting the results of my first homebrew, the Big Sky Amber Ale (thank you Weekend Brewer) it made the debut tasting at a holiday party this weekend to rave reviews by the partakers.  The tasters were being charitable considering this was my first attempt: “wow, it doesn’t make me want to throw up!”  In all fairness, the beer is a bit young at only one week in the bottle.  Over the next few weeks the taste should improve and the hoppy-ness should mellow. 


If you are considering brewing, I strongly encourage you to jump right in.  The process is fairly straightforward and the satisfaction of brewing your own beverage is quite rewarding.

Wednesday, December 5, 2007

DefaultButton, DefaultFocus and UniqueID vs ClientID

Wow, now I just stumbled upon something rather confusing.  I discovered one of my screens was deleting records by default (confirmation prompt of course) when users pressed ENTER so I went to set the DefaultButton to something more appropriate.  While I was at it, why not set the DefaultFocus too?  So I added the following code:


Page.Form.DefaultButton = btnComponentSearch.UniqueID

Page.Form.DefaultFocus = txtComponentName.UniqueID


That fixed the button, but the focus wasn’t working so I changed focus to


Page.Form.DefaultFocus = txtComponentName.ClientID


To my surprise it worked!  Then I thought…what happens if I change the DefaultButton:


Page.Form.DefaultButton = btnComponentSearch.ClientID


That resulted in the following error:

The DefaultButton of 'form1' must be the ID of a control of type IButtonControl.


So it could no longer find the control, how confusing…until I read this article about Naming:


Rendered name attributes correspond to UniqueID property and id attribute to ClientID property.


So gist is: VB.Net understands UniqueID, but for Javascript-ish stuff, you’ll need ClientID (except for the DefaultButton – which uses both J ).  Pretty crazy!

Monday, December 3, 2007

Bottled my first brew

With the help of a little child labor (my 5yo son helped), the first batch of malted beverage is carbonating in 28 bottles (22oz each).  A quick sample revealed a hoppy amber liquid that tasted something like beer.  Two more weeks to wait for the final product…