一. <%%>语法
<%%>这种格式实际上就是和asp的用法一样的,只是asp中里面是vbscript或者javascript代码,而在asp.net中是.net平台下支持的语言。特别注意:服务器控件中不能有<%%><%%>语法,例:![](https://i-blog.csdnimg.cn/blog_migrate/ec40054ca53243e863c5fd95dc13fc0a.gif)
<%
int a = 2;
int b = 3;
int c = a + b;
Response.Write(c);
%>
<% int a = 2; int b = 3; int c = a + b; Response.Write(c); %>
<%%>这种格式实际上就是和asp的用法一样的,只是asp中里面是vbscript或者javascript代码,而在asp.net中是.net平台下支持的语言。特别注意:服务器控件中不能有<%%><%%>语法,例:
![](https://i-blog.csdnimg.cn/blog_migrate/ec40054ca53243e863c5fd95dc13fc0a.gif)
<%
int a = 2;
int b = 3;
int c = a + b;
Response.Write(c);
%>
<% int a = 2; int b = 3; int c = a + b; Response.Write(c); %>