Wiley 978-0-7645-7860-1 Arkusz Danych

Przeglądaj online lub pobierz Arkusz Danych dla Podręczniki do oprogramowania Wiley 978-0-7645-7860-1. Wiley Professional Web Parts and Custom Controls with ASP.NET 2.0 Instrukcja obsługi

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 20
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 0
Creating Your Own Controls
ASP.NET comes with its own set of server-side controls so why create your own? And why
would you need three different kinds of controls: custom controls, Web Parts, and user controls?
By creating your own controls, you can build powerful, reusable visual components for your
Web application’s user interface, including components that allow your users to customize and
personalize your application. This chapter introduces you to the two primary types of controls
(custom controls and Web Parts) along with user controls. You’ll also see how creating your own
controls can simultaneously improve the quality of your Web applications, make you more pro-
ductive, and improve your user interfaces.
The Three Kinds of Controls
Why three different kinds of controls? Part of the reason is historical: Custom controls and user con-
trols were introduced in the first version of ASP.NET, while Web Parts are new to ASP.NET 2.0 and
add functionality that wasn’t available in user controls and custom controls. So, from one perspec-
tive, Web Parts are different from user controls and custom controls because they are “newer”not
a very important difference. As you’ll see, Web Parts are really just an extension of custom controls,
but that new functionality provides developers with the opportunity to deliver something new: the
ability for users to customize Web pages. But even that description doesn’t really help distinguish
among the three types of controls: while Web Parts are a special class of control, you can use both
user controls and custom controls as Web parts (although they won’t have all the customization
facilities of a full-fledged Web Part).
Web Parts, custom controls, and user controls all allow you to create reusable components that can
be used, in turn, to create Web pages in ASP.NET. Web Parts, custom controls and user controls in
ASP.NET 2.0 look very much alike when you are using them to build Web pages. All can be used
in Design view, for instance you can drag them onto a page, resize them, and set their properties
in the Property window. The major difference is that you drag custom controls and Web Parts from
the toolbox in Visual Studio .NET but you drag user controls from Solution Explorer. However,
05_57860x ch01.qxd 10/4/05 9:26 PM Page 3
COPYRIGHTED MATERIAL
Przeglądanie stron 0
1 2 3 4 5 6 ... 19 20

Podsumowanie treści

Strona 1 - COPYRIGHTED MATERIAL

Creating Your Own ControlsASP.NET comes with its own set of server-side controls — so why create your own? And whywould you need three different kinds

Strona 2 - User Controls

Figure 1-412Chapter 105_57860x ch01.qxd 10/4/05 9:26 PM Page 12

Strona 3 - Custom Controls

It would be convenient to have a single control that could be used to build all lists. This control could beimplemented in one of two ways: it could e

Strona 4

Figure 1-5 14Chapter 105_57860x ch01.qxd 10/4/05 9:26 PM Page 14

Strona 5

When to Use a User ControlUser controls should be your first choice for creating Web Parts where the control will be used on a sin-gle Web site only a

Strona 6

Studio .NET designer, it’s going to take much longer to lay out your user interface. And, without thebenefit of Visual Studio .NET’s IntelliSense supp

Strona 7

When you build an application, you are faced with decisions on what user interface will work best for your users. For instance, the application’s desi

Strona 8 - Controls in Action

❑ Listing books: One control might provide a single column with limited options for sorting thelist, another control could support complex sorting opt

Strona 9

All of this work, both in the infrastructure that supports your Web application and in the applicationcode behind your login page, has just one purpos

Strona 10 - Chapter 1

Figure 1-6Within the area of user management, some other features of SharePoint have also migrated intoASP.NET 2.0. Within SharePoint, it’s possible f

Strona 11 - Creating Your Own Controls

The final component of the personalization framework is the profile service. A profile is all the data associated with a specific identity. The profil

Strona 12

because both user controls and custom controls can be used as Web Parts, you can drag customizationcomponents from both the Toolbox and Solution Explo

Strona 13 - When to Use a Custom Control

05_57860x ch01.qxd 10/4/05 9:26 PM Page 22

Strona 14

all of your development without the benefit of a drag-and-drop designer). As you’ll see in this book, allthe features that you can take advantage of i

Strona 15

This description of how a Web Part is used on a SharePoint site omits an important step. After a WebPart is created it is added to one of several Web

Strona 16 - Providing for Personalization

Beyond Reusability with Web PartsThrough customization, Web Parts give you the opportunity to gain a new and more challenging class of benefits: you c

Strona 17 - Framework

Undoubtedly, the user community for your application will contain a variety of users, many with special-ized needs. It’s entirely possible that every

Strona 18

Figure 1-2Implementing Reusability with ControlsOne of the key ways to improve your productivity as a developer is through the re-use of components. I

Strona 19

When most developers think of “objects” they think of middleware components— items used to encapsulate business logic and data access that are called

Strona 20

Obviously, many components in this application can be written once and then reused. For instance, a setof business rules that calculate a customer’s c

Komentarze do niniejszej Instrukcji

Brak uwag