Using Web Parts in ASP.Net 2.0 - Changing the Layout
(Page 4 of 4 )
If you are to deliver a truly personalized experience, you should allow users to arrange the web parts however they prefer. You do this by adding the personalization provider control to the page, called WebPartPageMenu, like this:
<asp:WebPartPageMenu text=”change this page” Font-Size=”9px”
runat=”server” id=”myMenu” />
This gives users a menu with the following options:
- Browse this page (default)
- Add Web Parts to this page
- Design Page Layout
- Modify the Web Part Settings
- Connect Web Parts on this page
Just as with everything else in the .Net framework, we’re not stuck with the default verbiage that Microsoft provides. In development we can redefine the verbs through the ModeVerb collection of properties.
By selecting a different option, the users enter the specified mode. They can move the web parts around by choosing design mode. If they move a web part to a new zone, the web part inherits that zone's defined visual properties. And the beautiful thing is that when you specify a data provider, any modifications they make persist. In other words, the next time that specific user visits the site, ASP.Net serves them up their page in the way they left it. Now that’s personalization!
Conclusion
Web parts are big, but they’re going to be huge. They allow us as programmers to do the initial coding to get them up and running, and hand off the rest of the work to the users, who needn’t know a line of code to customize their web pages. In the near future, they will no doubt be seamlessly integrated into everything that Microsoft produces for public consumption, such as the "My Space" available through MSN Messenger. The ability to build and consume Web Parts will become a required skill for any web programmers working in a company with a .Net based intranet website. So brush up now!
There are still three major components to Web Parts. Those are editing, the Web Part catalog, and interconnecting Web Parts. These will be the topic of a future article. For now you have enough information to keep you busy!
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |