To my surprise, the site generated by the Dynamic Data Web Site is amazingly flexible, clear, and easy to configure. There is a master page and css class included with the site. As you would imagine, but replacing the master page in the site with the client's standard master page, and by changing the colors and styles in the css, I had the dynamic site matching the client's standard look and feel in minutes. To do this, look at the DynamicData/PageTemplates folder. There are 5 aspx pages that you will need to modify. Change the master page to point to the standard one. Then rename the content section to the master page's content body, and maybe (as I did) move some content into new content sections to rearrange the page a bit. It was that easy.
But what about the security functionality? My client uses a well-designed page inheritance hierarchy that exposes security information. I was able to go into the code behind for the aspx pages I mentioned above and change them to inherit from the client's standard base page. This allowed me to use logic in the aspx pages to filter out functionality I didn't always want to display. For example, I would wrap the Edit buttons on the list page in an if block like this:
If CanPerformAdminFunctions() Then
...
End If
In short, I was able to filter out any and all functionality from users that I wanted to be able to see the data but not edit it.
On a more detailed note, we also had an issue with bit fields in the database--sometimes we had nullable bit fields. This means the standard Yes/No check box display for a bit is not sufficient; you need a tristate control. The easiest solution is either a drop down or radio button list. Either way, this change was easy to manage--just swap out the control in FieldTemplates/BooleanEdit for a new control and add in some logic to set the field value to nothing if it is not set.
All in all, I have been extremely impressed with the ability to change, edit, and extend the functionality of the Dynamic Data Web Site. This is a great tool to have in your tool box, whether you need a quick and dirty admin site, or you want to start with a simple site and extend it to meet your needs.
Good luck out there!
0 comments:
Post a Comment