ASP.NET CONTROLS

ASP.NET CONTROLS

ASP. Net controls are very important for the ASP.Net framework. It is a .Net class that runs on the server and provides some of its elements to the browser. ASP.Net's framework has more than 70 controls that allow it to perform everything from displaying a list of records in a database to changing the format of an advertisement. Here is a brief description of the controls included in the ASP.Net framework.


ASP.Net controls a brief description (Overview of ASP.NET Controls)


The ASP.Net framework (version 2.0) has more than 70 controls. They can be divided into the following eight categories:


Standard Controls: - With the help of these, the elements of the form such as buttons, input fields, and labels work.


Validation Controls: - This allows the data to be validated or checked before presenting it to the server. For example, you use the RequiredFieldValidator control to check whether a user has entered a value in the field.


Rich Controls: - It controls the calendar, file upload buttons, banner ads, and multi-step wizard controls.


Data Controls: - With the help of these, work is done on the data of the database. For example, you can use them to add records to the database and to show a list of database records.


Navigation Controls: - These depict common navigation elements such as menus, T-views, and braid-crumb trails, etc.


Login controls: - With their help, functions like displaying login, changing the password, and registering forms are done.


Web Part Controls: - They are used to create personal reason-able portal applications.


HTML Controls: - These convert HTML tags into server control.


For example, to display the text input field on a page, a text box control can declare it like this:


<asp: Textbox id = “textBox1”  runat  = “Server” />{codeBox}


The declaration of this control looks like the declaration of the HTML tag. Remember, unlike the HTML tag, the control is a .Net class that is executed on the server and not in the web browser.


When the text box is given to the control browser, it consists of the following components: -


<input name= “Text Box1” type= “text” id= “TextBox1” />{codeBox}


The first part of the control declaration points to the namespace of the asp control. All standard ASP.Net controls are located in the System. Web. UI.Web controls namespace. Then further, the name of the Controller to be declared. In this case, the text box control is being declared.


This declaration also includes ID attributes. You use this ID to refer to the page control with your code. Which points to the control in your code. Each control must have a completely different ID.


Note: - You should always give an ID to each control even if you do not need to create a program for it. If you do not do this, some features of ASP.Net such as data-binding will not work.


This declaration also includes the run at = "server" attribute. This attribute causes the tag to be server-side controlled. If you do not pay attention to the inclusion of this attribute, this text box will not be executed in the browser and the browser also will not pay attention to this tag.


Forward slash (/) is used to end the tag. An example of this is as follows -


</ asp: TextBox>. If you wish, you can declare the text box control as follows:


<input name = “TextBox1”  type=“type” id=”TextBox1”></asp: textbox>


In this case, the slash is not at the beginning of the tag but at the end.


HTML controls using (Using HTML Controls)


HTML controls are declared differently than standard ASP.Net controls. In the ASP.Net framework, you can take any HTML tag and add run at = "Server" attribute with this tag. It converts special HTML tags to the ASP.Net control of the server-side.


For example, the following list has a <span> tag that has been changed in the ASP.Net control:


<%@ Page Language=”VB”%


<!DOCTYPE html PUBLIC” //W3C//DTD XHTML 1.0 Transitional//EN” http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>


<script runat=”server”>


</script>


<html xmlns= “html://www.w3.org/1999/xhtml”>


<head runat= “server>


<title>Untitled Page</title>


</head>


<body>


<span runat= “server”>


</span>


<form id= “form1” runat= “server”>


<div>


 

</div>


</form>


</body>


</html>{codeBox}


Note that the <spam> tag in the list looks like a simple HTML tag except that the run at = "server" attribute has been added to it. Because the <span> tag is a server-side HTML control, you can write programs for it. The <span> tag in the list is in the page-load () method, given the current date and time. HTML controls are included in ASP.Net's framework to make it easier to change.


AKASH TIMES

I AM AN ENGINEER BY PROFESSION BUT BLOGGER IS MY OLD DAYS DREAM TO CREATE MY OWN SITE FOR THOSE WHO ARE CURIOUS ABOUT MY BIRTHPLACE THEN I AM COMING FROM (INDIA). THE CURRENT CITY LIVES IN NAVI MUMBAI, INDIA

Post a Comment

IF YOU HAVE ANY PROBLEM PLEASE FELL FREE TO CONTACT US BY - AKASH TIMES

PREVIOUS POST NEXT POST