Skip to Main Content
Programming ASP.NET 3.5, 4th Edition
book

Programming ASP.NET 3.5, 4th Edition

by Dan Maharry, Dan Hurwitz, Jesse Liberty
October 2008
Intermediate to advanced content levelIntermediate to advanced
1166 pages
28h 31m
English
O'Reilly Media, Inc.
Content preview from Programming ASP.NET 3.5, 4th Edition

Web Parts

Web parts allow your users to reconfigure sections of your site to meet their own needs and preferences. Many information providers allow users to pick which content they want displayed and in which column to display it. Web parts allow you to provide that functionality with drag and drop “parts” of your page.

Web Parts Architecture

Web parts are created and managed on top of personalization using a structural component, called the WebPartManager control, to manage the interaction of web parts and UI controls to create user-managed interfaces.

Every web part page has a WebPartManager control. This invisible control tracks all the individual web part controls and manages the web part zones (described shortly). It also tracks the different display modes of the page, and whether personalization of your web part page applies to a particular user or to all users.

You’ll need to make sure the WebPartManager is placed at the top of the page. ASP.NET will throw an error if you run this page and the WebPartManager is declared lower in the source than any of the web parts that it is managing: between the form and div tags at the top of the page should be fine. For example:

<body>
   <form id="form1" runat="server">
      <asp:WebPartManager ID="WebPartManager1" runat="server" />
      <div>
         ... rest of page ...

The WebPartManager uses another ASP.NET provider, this time the AspNetSqlPersonalizationProvider, to store the current location of the contents in the web parts in your database. Like the providers ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Microsoft® ASP.NET 3.5

Programming Microsoft® ASP.NET 3.5

Dino Esposito
Learning ASP.NET 3.5, 2nd Edition

Learning ASP.NET 3.5, 2nd Edition

Brian MacDonald, Dan Hurwitz, Jesse Liberty
Pro ASP.Net 4 in C# 2010

Pro ASP.Net 4 in C# 2010

Matthew MacDonald, Adam Freeman, Mario Szpuszta
Programming .NET 3.5

Programming .NET 3.5

Jesse Liberty, Alex Horovitz

Publisher Resources

ISBN: 9780596156657Supplemental ContentErrata Page