Chapter 5. Creating Custom Controls with User Controls


Chapter 5. Creating Custom Controls with User Controls

IN THIS CHAPTER

  • Including Standard Content with User Controls

  • Exposing Properties and Methods in User Controls

  • Exposing Web Controls in User Controls

  • Exposing Events in User Controls

  • Loading User Controls Programmatically

In this chapter, you learn how to create and work with user controls. A user control is an ASP.NET page that has been converted into a control. User controls enable you to easily reuse the same content and programming logic on multiple ASP.NET pages.

In the first section, you learn how to use user controls to display the same content on multiple ASP.NET pages. For example, you learn how to construct a standard page header and footer with a user control and display them on multiple pages.

Next, you learn how to use user controls to package multiple controls into a single control. For example, you learn how to package multiple Web controls into a single user control that represents an address form.

Finally, you learn how to dynamically load user controls into an ASP.NET page. You also learn how to set properties and call methods of a dynamically loaded user control.

NOTE

You can view "live" versions of many of the code samples in this chapter by visiting the Superexpert Web site at:

http://www.Superexpert.com/AspNetUnleashed/




ASP.NET Unleashed
ASP.NET 4 Unleashed
ISBN: 0672331128
EAN: 2147483647
Year: 2003
Pages: 263

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net