Exforsys.com
 
Home Tutorials ASP.NET 2.0
 

ASP.NET 2.0 Free Tutorials : Using Web Parts and Controls in Web Pages

 

ASP.NET 2.0 Free Tutorials : Using Web Parts and Controls in Web Pages - Page 2

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.





First Page: ASP.NET 2.0 Free Tutorials : Using Web Parts and Controls in Web Pages


Read Next: ASP.NET 2.0 Free Training : Web Pages and Layout



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape