21 Controls in ASP
21 Controls in ASP
1. HTML Controls:
HTML controls are standard HTML elements like text boxes, buttons, checkboxes, and
radio buttons. You can use these controls in ASP.NET as well.
```html
```
2. Web Controls:
ASP.NET provides a set of web controls that are server-side controls. These controls are
more powerful and flexible than HTML controls and are managed by the server.
```html
```
In the above example, `btnSubmit_Click` is the event handler in the code-behind (C#) file.
3. Code-Behind:
ASP.NET applications use a code-behind model, where you write C# (or VB.NET) code to
handle events and control the behavior of the web page.
```csharp
protected void btnSubmit_Click(object sender, EventArgs e)
```
4. Validation Controls:
```html
```
5. User Controls:
User controls allow you to create reusable components for your web application. These
controls consist of a mixture of HTML and server-side code and are especially useful for
creating custom controls.
6. Third-Party Controls:
You can also use third-party control libraries like Telerik, DevExpress, and Infragistics to
add advanced functionality to your web application.
7. AJAX Controls:
ASP.NET AJAX controls enable you to create more interactive web applications with
features like asynchronous postbacks and client-side scripting.
Example - Using an AJAX Control (ScriptManager):
```html
```
8. Data Controls:
Data controls like GridView, ListView, and Repeater are used for displaying and working
with data retrieved from databases.
```html
</asp:GridView>
```