Murach's ASP.NET Web Programming with VB.NET

This chapter teaches you the basics of developing custom server controls. Although these are similar to user controls (covered in chapter 10), they’re more powerful. They’re also more difficult to develop because Visual Studio doesn’t provide a designer interface to help you create them.

Chapter 17 How to develop custom server controls
An overview of custom server controls 562
An introduction to custom server controls 562
How custom server controls compare with user controls 564
Three types of custom server controls 566
How to create a simple custom server control 568
The default class for a custom server control 568
How to override the Render method for a custom control 570
The design of the DaysUntil control 572
The code for the DaysUntil control 572
How to create and use a web control library 576
A procedure for creating and using a web control library 576
Step 1: Create a new Web Control Library project 576
Step 2: Edit the AssemblyInfo.vb file to specify the tag prefix 578
Step 3: Create the custom server controls 578
Step 4: Create an icon for each control 580
Step 5: Add a test project to the solution 580
Step 6: Build the web control library 582
Step 7: Add the controls to the Toolbox 582
Step 8: Test the custom controls 584
Additional programming techniques for custom controls 586
How to use the HtmlTextWriter class to render HTML 586
How to use designer attributes 588
How to raise events in a custom control 590
How to create a superclassed control 592
How to code a superclassed control 592
The design of the CaptionedBox control 592
The code for the CaptionedBox control 594
How to create a composite control 598
How to code a composite control 598
The design of the DateDDL control 600
The code for the DateDDL control 600
t




Murach's ASP.NET Web Programming with VB.NET

Learn more about this book

Add this book to your cart