Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Photos | Blogs | Beginners | Advertise with Us
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
DevExpress UI Controls
Search :       Advanced Search »
Home » ASP.NET and Web » ASP.Net Controls

ASP.Net Controls

In this article we will discuss, what are the controls used on ASP.Net page.

Author Rank :
Page Views : 478
Downloads : 0
Rating :
 Rate it
Level : Beginner
   Print Read/Post comments Post a comment  Similar Articles  
   Email to a friend  Bookmark  Author's other articles  
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 


Introduction

 

ASP.NET controls are the heart of the ASP.NET Framework. An ASP.NET control is a .NET class that executes on the server and renders certain content to the browser.

 

The ASP.NET Framework 2.0 contains over 70 controls. These controls can be divided into eight groups as given below:

  • Standard Controls: The standard controls enable us to render standard form elements such as buttons, input fields, and labels.
  • Validation Controls: The validation controls enable us to validate form data before you submit the data to the server. For example, we can use a RequiredFieldValidator control to check whether a user entered a value for a required input field.
  • Rich Controls: The rich controls enable us to render things such as calendars, file upload buttons, rotating banner advertisements, and multi-step wizards.
  • Data Controls: The data controls enable us to work with data such as database data. For example, you can use these controls to submit new records to a database table or display a list of database records.
  • Navigation Controls: The navigation controls enable us to display standard navigation elements such as menus, tree views, and bread crumb trails.
  • Login Controls: The login controls enable us to display login, change password, and registration forms.
  • Web Part Controls: The Web Part controls enable us to build personalizable portal applications.
  • HTML Controls: The HTML controls enable us to convert any HTML tag into a server-side control.

 

With the exception of the HTML controls, we declare and use all the ASP.NET controls in a page in exactly the same way. For example, if we want to display a text input field in a page, then you can declare a TextBox control like this:

 

<asp:TextBox id="TextBox1" runat="Server" />

 

This control declaration looks like the declaration for an HTML tag. Remember, however, unlike an HTML tag, a control is a .NET class that executes on the server and not in the web browser. When the TextBox control is rendered to the browser, it renders the following content:

 

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

 

The first part of the control declaration, the asp: prefix, indicates the namespace for the control. All the standard ASP.NET controls are contained in the System.Web.UI.WebControls namespace. The prefix asp: represents this namespace. Next, the declaration contains the name of the control being declared. In this case, a TextBox control is being declared. This declaration also includes an ID attribute. We use the ID to refer to the control in the page within our code. Every control must have a unique ID. It is good practice to use ID attribute to every control even when we don't need to program against it. If we don't provide an ID attribute, then certain features of the ASP.NET Framework won't work. The declaration also includes a runat="Server" attribute. This attribute marks the tag as representing a server-side control. If we neglect to include this attribute, then the TextBox tag would be passed, without being executed, to the browser. The browser would simply ignore the tag. Finally, notice that the tag ends with a forward slash. The forward slash is shorthand for creating a closing </asp:TextBox> tag.

 

HAVE A GREAT CODING!

Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post Here.
Login to add your contents and source code to this article
 [Top] Rate this article
 
 About the author
 
Abhimanyu Kumar Vatsa
http://www.itorian.com/about/
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Discover the top 5 tips for understanding .NET
Ricky Leeks presents the top 5 tips for understanding .NET Interoperability. Learn more.
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
 
 Post a Feedback, Comment, or Question about this article
Subject:
Comment:
Mindcracker MVP Summit 2012
Become a Sponsor
 Comments
what's new in this? by Nikhil On August 30, 2010
What's new in this article Vasta. and i think this concept has been posted many times before.
and is this an article ?
Reply | Email | Modify 
Re: what's new in this? by Abhimanyu Kumar On August 30, 2010
yes, you are right.
Reply | Email | Modify 
DevExpress Free UI Controls
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.