. Net Is Object-Oriented Programming, and all its elements exist in the form of controls. Let's take a look at the ASP. NET-Server Control instance tutorial.
. Net Is Object-Oriented Programming, and all its elements exist in the form of controls. Let's take a look at the ASP. NET-Server Control instance tutorial.
The server control mark is a server that understands.
Limited to traditional ASP
The following list copies the previous chapter:
The above code illustrates the limitation. The classic ASP: the code block must appear in the output you want.
Unlike the classic ASP, it is impossible to execute code independently from the HTML itself. This makes the webpage difficult to read and maintain.
ASP. NET-server controls
ASP. NET solves the "pasta code" problem, as described above in the server control.
The server control mark is a server that understands.
There are three server controls:
HTML Server Control-traditional HTML labels
Web Server Control-New a sp. NET tag
Verify the Server Control-for input verification
ASP. NET-h tml Server Control
The HTML tag of the HTML Server Control is understood by the server.
HTML elements are considered as text by default in ASP. NET files. To make these elements programmable, runat = "server" is added"
The HTML element of the attribute. This attribute indicates
The content should be considered as a server control. This attribute adds server identification control. The reference ID can be used to control the running status of the server.
Note: All HTML server controls must be in the runat = "server" attribute of a <form> flag. The runat = "server" attribute indicates that,
Form should be processed on the server. The report also states that the attached control can be performed through the server script.
In the following example, we declare that the HtmlAnchor server is controlled. Aspx file. Then,
We have manipulated the HtmlAnchor attribute of HREF to control it in an event handler (an event handler is a subprogram's Execution Code for a specific event)
. The Page_Load event is an event. Many ASP. NET understandings:
<script runat="server">Sub Page_Loadlink1.HRef=http://www.111cn.cnEnd Sub</script>
<form runat="server"><a id="link1" runat="server">Visit 111cn.cn!</a></form>
</body>