|
Page 2 of 2
.
.
To create content for the main zone
1. In Design view, drag a Label control from the Standard tab of the Toolbox into the contents area of the zone whose ID property is set to MainZone.
2. Switch to Source view. Notice that a < zonetemplate > element was added to wrap the Label control in the MainZone.
3. Add an attribute named title to the < asp:label > element, and set its value to Content. Remove the Text="Label" attribute from the < asp:label > element. Between the opening and closing tags of the < asp:label > element, add some text such as Welcome to my Home Page within a pair of < h2 > element tags. Your code should look as follows.

Click here to veiw sample code
4. Save the file.
Now let us create a user control that can also be added to the page as a web parts control.
To create a user control
1. Add a new Web user control to your site. Let us add a calendar control to the “Main” section below the label control.
2. Switch to Design view. From the Standard tab of the Toolbox, drag a Tree view control to the SideBar Zone. Right click on the control and select Edit nodes.

The treeeview nodes editor window opens

3. Now create a Root node, child nodes and click ok.
4. If you wish to make your site colorful, you may set different background, foreground and title properties to your controls.

5. Save and close the file.
6. Click F5 to execute the application.
Note that in the title bar of each control there is a downward arrow that provides access to verbs menu. Click on the down arrow and see the actions that can be performed.
The code for Start.aspx should now look like this:
Click here to veiw sample code
The final page as displayed in the browser may look like this.

Trackback(0)

|