Geeks With Blogs
Shravan's Articles on .NET A .NET Blog

An ASP.NET Control is .NET class that execute on the server and renders the certain content into the browser.

ASP.NET provides over 70 controls.We can use these wide range of controls for basic thing like to display the static text to displaying the records in database.

Here is an over of controls available in ASP.NET Framework 3.5.

Standard Controls : The standard controls enable you to render form elements such a buttons,labels,lists,input fields.

Data Controls : The data controls enable you to work with data such as database data or XML data.

Validation Controls : The validation controls enable you to validate form data before you submit the data to server.

Navigation Controls : The navigation controls enable you to display standard navigation elements such as menus,tree view, and bread crumb trails.

Login Controls : The login controls enable you to display the controls like login,registration form,change password.

WebParts Controls : The webparts controls enable end users to modify the content, appearance, and behavior of Web pages directly in a browser.

AJAX Extensions Controls : The AJAX Extensions controls enable you to add AJAX functionality to an ASP.NET application without writing any JavaScript.

Dynamic Data Controls : The Dynamic Data controls enables you to quickly build a functional data-driven application, based on a LINQ to SQL or Entity Framework data model.

HTML Controls : The HTML controls enable you to convert any HTML control into a server control.

Rich Controls : The rich controls enable you to render things such as calenders,ad rotators,file upload, multi-step wizards.

Already we are familiar with HTML Controls, In the same way we can declare the ASP.NET controls.

For example if we want to display a text field in a page we can declare a TextBox control like this

<asp:TextBox id="TextBox1" runat="server"/>;

When this TextBox control is rendered to the browser , it renders the following content:

<input name="TextBox1" id="TextBox1" type="text"/>;

The ASP part of the control declaration, the asp: is the prefix, indicates the namespace for the control. All the standard ASP.NET controls are contained in System.Web.UI.Webcontrols namespace.

Next, the declaration contains the name of the control being declared.

Next it also includes ID attribute. We can use this is ID to refer to the control in the page with our code. Every control must have a unique ID.

The declaration also includes a runat="server" attribute. This attribute marks the control as a sever-side control. If we neglect to include this attribute, then TextBox tag would be passed,with out being executed, to the browser. The browser would simple ignore the tag.

Posted on Friday, December 25, 2009 12:42 AM ASP.NET | Back to top

Copyright © Shravan Kumar | Powered by: