Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 5 - Using Themes and Skins for Personalization...
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Using Themes and Skins for Personalization with Visual Basic 2005
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2006-12-07

    Table of Contents:
  • Using Themes and Skins for Personalization with Visual Basic 2005
  • Organize Site Themes and Skins
  • Enable Themes and Skins
  • Using Named Skins
  • Web Parts
  • Enabling Editing and Layout Changes
  • Editing a Part

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Using Themes and Skins for Personalization with Visual Basic 2005 - Web Parts
    (Page 5 of 7 )

    Web Parts allow your users to reconfigure sections of your site to meet their own needs and preferences. Many information providers allow the user to pick which content they want displayed and in which column to display it. Web Parts allow you to provide that functionality with drag-and-drop “parts” of your page.

    Create a New Site

    To learn about Web Parts, create a new web site (call it WebParts) and copy the SitePersonalization web site from the beginning of this chapter (not the Themes web site you just completed).

    Set the Welcome page as the start page and make sure you can log in with an account you created previously (or, alternatively, setCreateAccountas the start page and create a new account to work with).

    Web Parts Architecture

    Web Parts are created and managed on top of personalization using the WebPartManager control to manage the interaction of Web Parts, and normal ASP UI Controls to create the user-managed interface.

    Creating Zones

    A page that uses Web Parts is divided into zones: areas of the page that can contain content and controls that derive from the Part class (Part controls). They can also contain consistent UI elements (header and footer styles, border styles, etc.) known as the chrome of the control.

    It is typical (though certainly not required) to organize these zones using tables.

    To see a simple example of Web Parts at work, follow these steps:

    1. Create a new page called WebPartsDemo.aspx.
    2. Open the WebParts section of your Toolbox, and drag aWebPartManageronto your page.

      The job of theWebPartManageris to track and coordinate all the Web Part controls on the page. It will not be visible when the page is running.
    3. Add a new table, with two rows and three columns. Rearrange the columns so that they are not of even size.
    4. Drag aWebPartZoneinto each of the six table cells. EachWebPartZonewill have a default name (e.g.,WebPartZone6) and a default heading. You can easily modify either or both of these properties in the Properties window, as shown in Figure 12-50.

    Set theHeaderTextproperty on the first Web Part control toNews.

    Adding Controls to Zones

    Drag a Label control into the zone. The normal ASP.Label control is automatically wrapped in a Web Part control, and its title is set to Untitled, as shown in Figure 12-51.


    Figure 12-50.  Web Parts Zones


    Figure 12-51.  Label Web Part

    Switch to Source view and set theTitleproperty of the label to Today’s News and the text to<br/>New Translation of In Search Of <em>Lost Time</em> Sets English World On Fire.

    Title is not normally a property of the Label control, and will not show up in the Properties window or IntelliSense. However, when you add it to aWebPartZoneit is wrapped, at runtime, in aGenericWebPart control that does recognize this property. Ignore intelliSense and press on.

    Switch back to Design view and drag aListBoxcontrol intoWebPartZone3. Set the header text for theWebPartZonetoSponsors. Click on theListBox, and then on its smart tag and then click on Edit Items to open the ListItems Collection Editor. Add a few items to theListBox. Back in Source view, set theTitle property toOur Sponsors. (This control, like theLabelcontrol, does not inherently have aTitle
    property, so IntelliSense will complain, but as the note above explains, all will be well.)

    Add a link in theLoggedInTemplatein Welcome.aspx, to take the user to your new page and run the program. Login using one of the accounts you set up previously and click on the link to the new Web Parts page.

    You should see two Web Parts, as shown in Figure 12-52.


    Figure 12-52.  Two Web Parts visible

    Minimizing and Restoring

    Click on the tag next to the title and a menu appears allowing you to minimize or close the Web Part, as shown in Figure 12-53.


    Figure 12-53.  Minimize or Close

    If you choose Minimize, the Web Part is minimized to its title, and the minimize tag offers the choices of Restore or Close, as shown in Figure 12-54.


    Figure 12-54.  Restore or close

    Exit the application. Start it again, sign back in, and navigate back to these pages. Aha! The minimized zone remains minimized. Each individual’s personalized Web Parts are automagically persisted through the personalization database.


    Web Parts

    Web Part controls derive from the Part class and are the essential UI of a Web Parts page. You can create custom Web Part controls or you can use existing ASP.NET server controls, user controls, and custom controls, all of which will be wrapped for you in a generic Web Parts control.


    More Visual Basic.NET Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Programming Visual Basic 2005," published...
     

    Buy this book now. This article is excerpted from chapter 12 of the book Programming Visual Basic 2005, written by Jesse Liberty (O'Reilly, 2005; ISBN: 0596009496). Check it out today at your favorite bookstore. Buy this book now.

    VISUAL BASIC.NET ARTICLES

    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic
    - Manipulating Forms with the Windows Forms Li...
    - Basics of the Windows Forms Library
    - Forms, Controls, and Other Useful Objects
    - Implementing OOP to Develop Database Oriente...
    - Using Themes and Skins for Personalization w...
    - A Deeper Look at Personalization using Visua...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway