When we build web application using asp.net framework, we have both server side controls and client side controls, many times we use client side controls at server by writing "runat=server"
attribute, but now there are all ready to use server side controls with lot more additional attribute and functionality, here we learn different type of server side controls in asp net with example.
Controls are basically ready to use mechanism for building web application, they all are different in nature, and we can classify asp.net server side controls based on behaviour or purpose
Broadly we can classify them in following categories
All Asp.Net controls comes under System.Web.UI.WebControls
Namespace, Here are the quick overviews
Let's look at different type of server side controls in asp.net.
Form control is used for designing form on Asp.net web page. We can add both html control and asp.net control for data capture in side form control, in case of using html control we need to add runat=server property value , we normally place textbox, dropdown list, listbox, radio button, checkbox controls inside form control.
This is how we define asp.net server side control<asp: textbox id=TextBox1 runat="Server" Text=" " text=" "> </asp:textbox>When we create a page in asp.net, the webform is created; we don’t need to write any additional form tag like HTML
There are many ready to use controls that allow dealing with collection of data, like displaying data, giving user an opportunity to manipulate data from UI, here are some popular data controls : GridView, Repeater, DataGrid, DataView, ListView, DataList
Menu, TreeView, SiteMapPath
Login, LoginView, PasswordRecovery, ChangePassword, CreateUserWizard
Ajax control comes with script manager and update panel, this allow us to create Ajax functionality, means anything we create within that panel, can make server side call without having any PostBack of entire page.
User control is a additional part which can have one or multiple asp.net controls with a fix set of functionality, can be easily integrated in any webpage, we can consider this as part of page, user control comes with .ascx file extension, we need to register on web page wherever we want to use them.
Custom controls are type of control that is developed on demand by us (developer); custom controls are deployed as individual assemblies; Custom controls has same life cycle like any other server side controls in asp.net.
public class WelcomeCompositeControl : System.Web.UI.WebControls.WebControl, INamingContainer { }
We can have multiple web controls in a custom control
You may be interested to read following posts