Check out Listing 11 and 12 under chapter 11 of"ASP.Net Unleashed" link available underhttp://www.superexpert.com