This link has been bookmarked by 37 people . It was first bookmarked on 18 Jul 2007, by wonglh.
-
30 Jun 14
-
All HTML server controls must be within a <form> tag with the runat="server" attribute. The runat="server" attribute indicates that the form should be processed on the server. It also indicates that the enclosed controls can be accessed by server scripts
-
-
07 Dec 12
-
29 Nov 12
-
- HTML Server Controls - Traditional HTML tags
- Web Server Controls - New ASP.NET tags
- Validation Server Controls - For input validation
-
syntax
-
<asp:control_name id="some_id" runat="server" />
-
syntax
-
<asp:control_name id="some_id" runat="server" />
-
-
07 Mar 12
-
25 Apr 11
Sohel BaruaServer controls are tags that are understood by the server.
There are three kinds of server controls:
* HTML Server Controls - Traditional HTML tags
* Web Server Controls - New ASP.NET tags
* Validation Server Controls - For input validation -
22 Mar 11
-
HTML Server Controls
-
Web Server Controls
-
Validation Server Controls
-
-
09 Feb 10
-
28 Oct 09
-
- HTML Server Controls - Traditional HTML tags
- Web Server Controls - New ASP.NET tags
- Validation Server Controls - For input validation
There are three kinds of server controls:
-
ASP.NET - HTML Server Controls
-
HTML elements in ASP.NET files are, by default, treated as text. To make these elements programmable, add a runat="server" attribute to the HTML element. This attribute indicates that the element should be treated as a server control. The id attribute is added to identify the server control. The id reference can be used to manipulate the server control at run time.
-
In the following example we declare an HtmlAnchor server control in an .aspx file. Then we manipulate the HRef attribute of the HtmlAnchor control in an event handler (an event handler is a subroutine that executes code for a given event).
-
<script runat="server">
Sub Page_Load
link1.HRef="http://www.w3schools.com"
End Sub
</script>
<html>
<body>
<form runat="server">
<a id="link1" runat="server">Visit W3Schools!</a>
</form>
</body>
</html> -
ASP.NET - Web Server Controls
-
Like HTML server controls, Web server controls are also created on the server and they require a runat="server" attribute to work. However, Web server controls do not necessarily map to any existing HTML elements and they may represent more complex elements.
-
The syntax for creating a Web server control is:
<asp:control_name id="some_id" runat="server" /> -
<script runat="server">
Sub submit(Source As Object, e As EventArgs)
button1.Text="You clicked me!"
End Sub
</script>
<html>
<body>
<form runat="server">
<asp:Button id="button1" Text="Click me!"
runat="server" OnClick="submit"/>
</form>
</body>
</html> -
ASP.NET - Validation Server Controls
-
Validation server controls are used to validate user-input. If the user-input does not pass validation, it will display an error message to the user.
-
The syntax for creating a Validation server control is:
<asp:control_name id="some_id" runat="server" /> -
In the following example we declare one TextBox control, one Button control, and one RangeValidator control in an .aspx file. If validation fails, the text "The value must be from 1 to 100!" will be displayed in the RangeValidator control:
-
<html>
<body>
<form runat="server">
<p>Enter a number from 1 to 100:
<asp:TextBox id="tbox1" runat="server" />
<br /><br />
<asp:Button Text="Submit" runat="server" />
</p>
<p>
<asp:RangeValidator
ControlToValidate="tbox1"
MinimumValue="1"
MaximumValue="100"
Type="Integer"
Text="The value must be from 1 to 100!"
runat="server" />
</p>
</form>
</body>
</html>
-
-
21 Jul 08
-
server controls.
-
- HTML Server Controls - Traditional HTML tags
- Web Server Controls - New ASP.NET tags
- Validation Server Controls - For input validation
-
To make these elements programmable, add a runat="server" attribute to the HTML element.
-
The id reference can be used to manipulate the server control at run time.
-
within a <form> tag
-
indicates that the form should be processed on the server.
-
enclosed controls can be accessed
-
manipulate the HRef attribute
-
Page_Load event
-
Web server controls do not necessarily map to any existing HTML elements
-
page validation is performed when a Button, ImageButton, or LinkButton control is clicked.
-
CausesValidation property to false
-
-
05 Mar 08
-
25 Feb 08
-
18 Jul 07
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.