Thursday, May 18, 2006


I am writing this blog entry the morning after a three day trip my buddy and I took to Texel and then Amsterdam. It was a long three days with much partying involved. We did a few cultural things in Amsterdam, but it seems the main attraction for my Canadian friends is not the Rijksmuseum.
Last night we caught the last train from Amsterdam back to Arnhem and went to the city here. We closed one bar, and felt the need to go to the after-hours place. After running out of money, I decided to go to an ATM and get some for a cab home. My freind decides he is in Holland and he needs to steal a bike. Lovely. He wouldn't get in the cab since he claimed to know where I live, and wanted to experience Holland on a stolen bike. After a while I just gave up and went home. He's a big boy and there is only so much I can do.
This happened at about 3am this morning and was also the last time I saw him. It's now 11am and I can't get a hold of him. I did get a voicemail at 6am from him, something about waking up in an alley and not having his backpack. He sounded pretty rough. I have to say I didn't expect this level of riddiculous when we set out three days ago. I hope my buddy had a good sleep in an alley somewhere, and I hope he shows up soon.

Update 3:20pm: No sign of my friend. Called the cops, called the local hospital, neither knows him so I take that as a good sign. Now I just wonder where the hell he is and why he won't pick up his phone.

Update 4:40pm: I get the following email "You fucking idiot!! I'm at a hotel in arnhem!! I was asleep until now!!" I'm glad he's ok, but I'm not sure who the "fucking idiot" is.

Wednesday, May 10, 2006

Setting css styles on an individual MenuItem

It's been a while since I've written a tech post, but I think it's that time again. I've been working on a website for a potential client and came across an interesting problem with .NET 2.0 MenuItems (System.Web.UI.WebControls.MenuItem). Basically the website has a menu that displays a number of items, and one of the items should be bold. Now if you've played with the Menu control in .NET 2.0, you'll know that there are a lot of options for setting styles on menu items. However, I have yet to figure out a nice clean way to set a particular css style on only one item in the same level of a menu. Here is what I did do that seems to work, but I'd prefer a cleaner way so I'm all ears.

I started by defining my SiteMapNodes in the web.sitemap file, and was pleased to find out that I could add a custom attribute to the node that I could then call from code:


<sitemapnode title="My Page" description="" url="mypage.aspx" displaybold="true">

In the code I hooked into the MenuItemDataBound event of the Menu control, and added the following code:

SiteMapNode s = (SiteMapNode)e.Item.DataItem;
string displayBold = s["displaybold"];
if (displayBold != null && Convert.ToBoolean(displayBold) == true)
  e.Item.Text = "<div class=mycssclass>" + e.Item.Text + "</div>";

Now there are a few things to notice here. First of all, there is a nice clean way to fetch the custom attribute I added in the web.sitemap file. Using this I was hoping to selectively apply a css style to the menu items that corresponded to site map nodes with the displaybold=true attribute. Now this is where I ran into trouble. There is no class or style property on a MenuItem control. I did a fair amount of reading and research but could not find any mention about this. So I tried the code that is listed above, and to my surprise it works like a charm. All I needed to do now was hook up a stylesheet to the page this control rendered itself on, and ensure there was a class called mycssclass in there.

Like I said, I'd prefer to know of a cleaner way of doing this if there is one, since I particularly hate hard coding html into my codebehind files.

Tuesday, May 09, 2006

What a week

This post is a bit delayed since I actually worked a 5 day week last week and wasn't in the mood to blog when I got home in the evening.

So I had Ryan over here for a week, and what a week it was. I think Ryan will at one point post a good entry about the week, but here are some of my favourite moments:

* Ryan:"Is that a urinal?" - Joe:"Yep, try it!" - Both pissing in the middle of the street.
* My Mom:"Is he going to kill himself?" - After Ryan's third 'morning smoke'.
* "Hi my name is Ryan!" as Ryan introduces himself to my Dad wearing the tight orange shirt he bought for Alex to wear on Queensday.
* "Tactical error.." - Ryan's experiment with amsterdam snacks.
* "If we pool our money, I know a guy that will give us a good deal on weed" - said about 100 times by this guy named Mike in the span of 30 minutes. That was incidentally the lenght of time it took us to meet and promptly ditch Mike. Hustling weed in Amsterdam just won't work...
* "What were we thinking, it's not like we're poor" - Ryan and Joe after spending the first night in the hostel.
* Ryan: "This is a weird place..." - commenting on the "opium den" in the hostel. No good photos online, I'll have to duck in there with Drew next week and get a pic. We spent a few hours in there chillin.

Suffice to say I had a good time but it took me a few days to recover from it. Drew is on his way here in a few days, but I have a feeling that will be more tame. Maybe not. His blog seems to indicate some heavy partying in the last little while.