User
controls, as you might guess, are controls that you write yourself. You create
these controls with any text editor, or with the assistance of an IDE like
Visual Studio.NET.
A user control can consist of text, HTML tags, HTML server
controls, and ASP.NET
server controls, along with any additional server-side
code to handle events and perform server-side processing. The purpose of a user
control is to provide the ability to reuse common user interface functionality
across your ASP.NET web applications. For example, consider a typical logon
page. You might have one textbox control for the logon name, another for the
password, and a button control to submit the form logon data to the server. You
might additionally have some validation controls to validate the user's input,
and various server- side code to perform the actual logon authentication. If
this was a common set of functionality that was going to be used by several
pages in your web application, you might consider creating a user control to
facilitate this functionality so that you only need write it once. You can
think of a user control as being very similar to an ASP.NET web form. However,
unlike a web form, a user control must always be included into an existing web
form in order to work. A user control cannot load independently from a web form
No comments:
Post a Comment