User Control Creation Techniques

User controls can be created in a method similar to the way you create your typical ASP.NET web form pages. The primary difference between ASP.NET web form pages and User controls is that User controls do not include <html><body> and <form runat="server"> tags within them. These tags would already be included in your ASP.NET web form page.

ASP.NET pages can contain only one <form runat="server"> tag per page. You can include as many standard <form> tags as you’d like, but there can be only one “web form” per ASP.NET page.

Creating User Controls

Let’s start out with a simple example of a form box that asks what the password is and go from there. The following are the User control pages. Notice that a User control ...

Get ASP.NET for Web Designers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.