Atlas and dasBlog 1.9: The better way
Evenin' Hillbillies. Got somethin' t'say on my upgrade to dasBlog 1.9 so iffen you'll turn your attention from your squirrel skinnin', I'd be much obliged.
The reason for my upgrade is solely to support FlareItems, something I could have done earlier with one of the intermediate codebases but I don't do nuttin' until Scott Hanselman tells me to.
It wasn't something I was looking forward to because I had bastardized my existing version to wedge Atlas controls into it. As it turns out, though, I was able to learn from my recent trials and tribulations and get the new version of dasBlog working with Atlas controls without having to embed the controls into the codebase itself. So what you see on this har site are the following AtlasControlToolkit controls in action with very minimal changes to the core code:
- TextBoxWatermark (in the search box)
- CollapsiblePanel
- RoundedCorners
In the previous version, I had embedded these controls server-side into the individual pieces, SideBarList, CategoryList, and so on and so forth. Which means these controls were useful in my theme and nowhere else. The brown rounded corners did not really lend themselves to...well...any other theme in the world.
Forthwith, a list of non-theme changes I made to dasBlog to support the inclusion of Atlas and the Atlas Control Toolkit:
- Upgrade the project to VS2005. Follow the instructions. They work.
- Add a reference to the Microsoft.Web.Atlas assembly in both the newtelligence.DasBlog.Web and newtelligence.DasBlog.Web.Core projects
- Add a reference to the AtlasControlToolkit assembly in the newtelligence.DasBlog.Web project. I'm not entirely certain this is necessary. It could be enough that you include the assembly in the bin folder because all the functionality is handled client-side. I.E. There are no actual server-side AtlasControlToolkit controls created.
- Modify the web.config to accommodate Atlas. This and the previous step are detailed here.
- Added the following code to the top of the Page_Load event in newtelligence.DasBlog.Web.Core.SharedBasePage:
Microsoft.Web.UI.ScriptManager manager = new Microsoft.Web.UI.ScriptManager( );
this.Controls.Add( manager );
- Re-compile
The second last step I think might be considered a little dicey. The rest of it is essentially what you would do to any application to Atlas-ize it. But I needed a place to put the ScriptManager and this seemed the logical choice. Unfortunately, it means you're getting a ScriptManager whether you want one or not.
The other option is to include script references to all of the Atlas javascript files in your template which I'm not too comfortable with because those seem to be dependent on the order in which they are loaded.
Anyway, that's it really. Now you can start using Atlas features in dasBlog. You might need to play around with the settings on the ScriptManager depending on what you're doing. The next entry, which I will post shortly, will detail what I did to include toolkit controls into my theme.