About Me

My photo
Fort Worth, TX, United States

Sunday, June 24, 2007

Get LoadPostData to fire on Web Custom Control with ASP.NET 2.0 (C#)

I was trying to write my first web custom composite control and for the life of me, I couldn't get the LoadPostData event to fire. After wrestling with this for a day, I stumbled onto this site that laid it down step-by-step. After checking these things, it worked.

Here's the article for reference:

LoadPostData doesn't fire

I've struggled with this a couple of times, but I think I've got it figured out now. When I implement IPostBackDataHandler on my ASP.NET server control, my LoadPostData event doesn't get hit. This is because I haven't read the MSDN documentation properly.

For a ASP.NET server control to handle postback data correctly, it has to meet the following criteria.
1. The class must implement IPostBackDataHandler.
2. Implement LoadPostData to load the form data.
3. The name (not the ID!) of one of the html controls it renders must exactly match the UniqueID of the control (I always forget this one).
4. Implement RaisePostDataChangedEvent.

Not too tricky.

Map My Run

Carla and I have been jogging around our neighborhood for the last month or so. A friend showed us this cool website called mapmyrun.com, so I started mapping out our runs. So far, we only have two, but I'll be adding more as we get more used to running.

Our runs

I'm done with DRM.

After a frustrating attempt to legally purchase and download a Breaking Benjamin song on Yahoo! Music, I've finally decided that I'm done with music that uses Digital Rights Management (DRM) protection. I don't know what I'm going to do as far as getting new music (maybe go back to buying CDs), but I've made up my mind about not supporting DRM.

Here's a funny (but true) video by the executive editor of ZDNet about DRM:

D.R.M. = C.R.A.P.

His video summarizes exactly how I feel about it, too, and I'm going to vote with my wallet and not buy anymore C.R.A.P.

Sunday, June 3, 2007

Visit to the Pistol Range

Carla and I went to On Target shooting range in Fort Worth to get some practice time with our Glocks. Carla's pistol is a G17 and mine is a G27, but today I was primarily firing 357 SIG and a little bit of 9mm through my gun.

Here are the pics:

Blog Archive