Home > DeveloperSection > Blogs > Server Control in ASP.NET

Server Control in ASP.NET

0 Comment(s)
 784  View(s)
Rate this:

Server Control in ASP.NET

In this blog, I’m explaining about server control  in .Net

 ASP.Net uses five types of web controls,which are:

1.      HTML controls

2.      HTML  sever controls

3.      ASP.NET server  controls

4.      ASP.NET Ajax Server controls

5.      Use controls and custom controls

ASP.NET server controls are the primary controls used in ASP.NET. These controls can be grouped into the following categories

Validation controls: These are used to validate use input and they work by running client-side script.

Data source controls: These controls provides data binding to different data sources.

Data view controls: These are various lists and tables, which can bind to data from data sources for displaying.

Personalization controls: These are used for personalization of a page according to the user perferences, based on user information.

Login and security controls: These controls provide use authentication.

Master pages: These controls provide consistent layout and interface throughout application.

Navigation controls: These controls help in navigation. For example, menus, tree view etc.

Rich controls: These controls implement special features. For example. AdRotator, fileupload and calendar control.

Syntax of server controls

<asp:controltype ID=”controlID” runat=”server” property1=value1 property2=value2>

AJAX server controls

AJAX= Asynchronous Java script and XML.

AJAX is  technique for creating fast and dynamic web pages.

AJAX, i.e. Asynchronous Javascript and XML, is the technique that can be used to have communication between the client  and server without needing a postback. The benefit of avoiding  postback is faster response to the use,  the page in the browser is not changed/refreshed posted so the  user can continue to use it while data is sent to the server and user  actions like keypresses can  also be communicated to the  server to provide more meaningful result.

Ajax is a set of W3C complaint technologies that  facilitate asynchronous communication between the client and server.

The  controls provided by ASP.NET for having AJAX functionality are

1.      ScriptManager

2.      ScriptManagerProxy

3.      UpdatePanel

4.      UpdateProgress

5.      Timer

ScriptManager Control

The ScriptManager Control is a non visual component on the page. It manages client script for  AJAX-enable ASP.NET web pages.


ScriptManagerProxy should be used on content pages that have master pages containing a scriptmanager control. It can also be used inside usercontrol when the page containing the UserControl already has the  ScriptManager control.

UpdatePanel Control

This is a container control that contains other ASP.NET controls. It performs partial-page updates and identifies content that is updated independently of the reset of the page.

UpdateProgress Control

The  UpdateProgress control provides a sort of feedback on the browser while one or more update panel controls are being update.

Timer Control

It performs postback at defined intervals. If you use the timer control with  an UpdatePanel control, you can enable partial-page updates at a defined interval.

  <asp:Timer ID="Timer1" runat="server" Interval="2000"></asp:Timer>


1.       Create a master page

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="AjaxExample.MasterPage" %>


<!DOCTYPE html>


<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">


    <asp:ContentPlaceHolder ID="head" runat="server">





    <form id="form1" runat="server">

         <div style="margin-left: 40px">

        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

         <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">







2.      Create .aspx file


<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="AjaxPage.aspx.cs" Inherits="AjaxExample.AjaxPage" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>


    <asp:Timer ID="Timer1" runat="server" Interval="2000"></asp:Timer>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">


            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />






                runat="server" Target="_top" Width="500px" />





    <asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="true" AssociatedUpdatePanelID="UpdatePanel1">



            <asp:Panel ID="PnlMain" runat="server" GroupingText="Login form" Direction="RightToLeft" HorizontalAlign="Center">



                        <td>user Name</td>


                            <asp:TextBox ID="txtUser" runat="server"></asp:TextBox></td>



                        <td>user Password</td>



                            <asp:TextBox ID="txtPass" runat="server" contentPlaceHoler="Enter password"></asp:TextBox></td>












3.      Create a xml file


<?xml version="1.0" encoding="utf-8" ?>




    <width>40px </width>




    <AlternateText>DotNetCurry Home Page</AlternateText>






    <width>40px </width>



    <AlternateText>DotNetCurry Home Page</AlternateText>









    <AlternateText>DotNetCurry Home Page</AlternateText>






You want to read HTML server control,         Server Side environment

Don't want to miss updates? Please click the below button!

Follow MindStick