This article describes the <script runat= "server" in asp.net in the use of >, share to everyone for your reference. Specifically as follows:
In the asp.net. aspx page, you can add code in the Cases:
Copy Code code as follows:
<script type= "Text/javascript" runat= "Server" >
void Select_change (Object sender, EventArgs e)
{
Response.Write ("select changed!");
}
</script>
As you can see, you can also use server-side Response.Write () to output content.
It should be noted that <script runat= "Server" > </script> can only place methods and properties, and not directly add statements and expressions.
In addition, in an. aspx page, you can also use the <%%> tag to refer to a server-side variable, or to display a server-side function return value to the client. However, the use of this tag has certain limitations, in which the function or subroutine cannot be declared, and only statements can be placed.
In practical applications, it is best to separate the front and back code, so that not only can make the code clear, easy to manage, but also fully embodies the asp.net and ASP differences.
I hope this article will help you with the ASP.net program design.