O'Reilly logo

Professional ASP.NET 3.5 AJAX by Matt Gibbs, Dan Wahlin, Bill Evjen, Dave Reed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

12.2. Building a Web Parts Page without AJAX

As you begin using the Portal Framework to build Web sites, note that the framework defines everything in zones. There are zones for laying out as well as for editing content. The zones that a page might incorporate are managed by a Portal Framework manager. The Portal Framework manager performs the management on your behalf, meaning that you do not have to manage them yourself in any fashion. This makes working with the Portal Framework a breeze.

This framework contains a lot of moving parts, and these multiple pieces that are heavily dependent upon each other. For this reason, this section starts by examining a simple page built with a couple of Web Parts. This page is presented in Listing 12-1.

Example 12-1. A simple page using Web Parts without AJAX
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.UI.WebControls.WebParts"%>
<%@ Register src="HelloUser.ascx" tagname="HelloUser" tagprefix="uc1" %>

<script runat="server">

    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
        }
    }

    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
        Label1.Text = "You selected " + Calendar1.SelectedDate.ToShortDateString();
    }

    protected void LinkButtonBrowse_Click(object sender, EventArgs e)
    {
        WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
    }

    protected void LinkButtonDesign_Click(object sender, EventArgs e)
{ WebPartManager1.DisplayMode ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required