alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow ASP.NET 2.0 arrow ASP.NET 2.0 Free Tutorials : Using Web Parts and Controls in Web Pages
Site Search


ASP.NET 2.0 Free Tutorials : Using Web Parts and Controls in Web Pages
Article Index
ASP.NET 2.0 Free Tutorials : Using Web Parts and Controls in Web Pages
Page 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)
Comments (0)add comment

Write comment

busy

 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape