Many thanks to everyone who attended the packed ASP.NET 2 session in Belfast last Tuesday!
I've had a number of requests for the Olive website code that we wrote during the 3-hour coding bonanza. I’ve handed it off to Damien McGivern, who has hosted the code on the NIMTUG site.
I’ve made some minor tweaks to the code for clarity, and also modifed it to illustrate two things:
Someone asked if it was possible to access the properties of a Control that is being used as a Web Part. In Default.aspx I’ve shown one technique for doing so. The key is this: The Controls property of your WebPartManager instance contains all of the individual Web Parts. In our Olive example, we were using ASP Controls as web parts, so they each get wrapped in a GenericWebPart, from which we can extract, for example, the AuthorsList control and modify it. If you're curious about Web Parts, take a look through the documentation for the Personalizable attribute, which allows for Profile-based persistent personalization of Web Parts.
You may have noticed that our updates to the NickName property in the user's Profile wasn’t immediately being reflected on the page ("Welcome, Olive!"). The page “ASP.NET Web Page Processing” in the VS 2005 documentation helped me understand why. (note: that's a local link to the beta docs). I’ve moved the updating of the Master Page’s Labels (which include details pulled from the Profile) from the Page_Load method to the Page_PreRender method. The rest is history.
So there you go! Don't hesitate to write me if you have any other questions about what we went through.
Many thanks are due to Scott, David, and Dave, whose presentations offered the foundation and inspiration for this one. Check out Scott's recent Channel 9 interviews -- they offer great insight into the ASP.NET "big picture"!