Sponsored Links
ASP.NET 2.0 Tutorials
- Advanced Site Functionality - ASP.NET 2.0
- ASP.NET : Dynamic Image control
- ASP.NET 2.0 Creating Web Wizards
- Displaying Master-Detail Data on Separate Pages in ASP.NET 2.0
- ASP.NET Displaying Master-Detail Data on the Same Page
- ASP.NET DataBound Controls - Details View
- ASP.NET : Using a Grid to Display Detail Information
- ASP.NET 2.0 : Adding Sorting and Paging in GridView
- ASP.NET 2.0 Tutorials : GridView Filtering
- ASP.NET GridView Control
- ASP.NET 2.0 Training : Data Bound Controls
- ASP.NET 2.0 Free Tutorials : SqlDataSource Control
- ASP.NET 2.0 Training : Data Source Object Model
- ASP.NET 2.0 Free Training : Setting Application-Level Caching
- ASP.NET 2.0 Tutorials : Configuring Page-Level Caching
- ASP.NET 2.0 Free Tutorials : Managing Membership and Roles
- ASP.NET 2.0 Free Tutorials : State Management And Caching in ASp.net 2.0
- Forms Authentication in ASP.NET 2.0
- ASP.NET 2.0 Training : ASP.NET Security
- ASP.NET 2.0 Training : Customizing the Session State Mechanism
Tutorials
ASP.NET 2.0ASP.NET 2.0 Free Training : Web Pages and Layout
Table of Contents
ASP.NET 2.0 Free Training : Web Pages and Layout
ASP.NET 2.0 Free Training : Web Pages and Layout - Page 2ASP.NET 2.0 Free Training : Web Pages and Layout
ASP.NET 2.0 Free Training : Web Pages and Layout
In this tutorial you will learn how to Enable Users to Edit Pages and Change Layout, To create a user control that enables changing page layout, To enable users to change the layout and To test layout changes.Enabling Users to Edit Pages and Change Layout
As stated earlier in this tutorial, Web parts facilitates the editing of Layout by users. Users can drag and drop controls by dragging them from one zone to another and the characteristics of controls can be edited. This functionality is inbuilt into the basic control set of the Web part. Custom controls can also be created that allow users edit the features. In this section of the tutorial we shall examine how this is done.
To create a user control that enables changing page layout
1. In Visual Studio, add a new user control in the same directory as the start.aspx file, and name the new file Menu.ascx.
2. Switch to Source view.
3. Remove the existing code in the new file, and paste in the following code. This user control code uses features of the Web Parts control set that enable a page to change its view or display mode, and also enables you to change the physical appearance and layout of the page while you are in certain display modes.
Click here to veiw sample code
4. Save the file.
To enable users to change the layout
1. Open the Start.aspx page, and switch to Design view.
2. Position the insertion point in the Design view just after the text you typed for the header of the page. Add a hard return after the text so that there is a blank line between the header and the WebPartManager control. Leave the insertion point positioned on the blank line.
3. Drag the user control you just created (the file is named Menu.ascx) into the start.aspx page and drop it next to the calendar control.
4. Drag an EditorZone control from the WebParts section of the Toolbox to the remaining open table cell in the start.aspx page.

5. From the WebParts section of the Toolbox, drag an AppearanceEditorPart control and a LayoutEditorPart control into the EditorZone control.

6. Switch to Source view. The resulting code in the table cell looks as follows.
Click here to veiw sample code
7. Save the Start.aspx file. You have created a user control that allows you to change display modes and change page layout, and you have referenced the control on the primary Web page.
To test layout changes
1. Load the page in a browser.

Next Page: ASP.NET 2.0 Free Training : Web Pages and Layout - Page 2
Comments
Sponsored Links
