如何嵌入code块在ASP.NET网页中? [英] how to Embedded Code Blocks in ASP.NET Web Pages?

查看:122
本文介绍了如何嵌入code块在ASP.NET网页中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里我们使用<%@%> <%=%> <%#%> 等。
还有什么ASP标签可以在asp.net网页中添加?

where we use <%@ %> <%= %> <%# %> etc. what else asp tags can be added in asp.net web pages?

推荐答案

&LT; %%&GT; 短手:

<script runat="server">
</script>

&LT内部点儿;%%GT; 是服务器端的code。

Anyting inside the <% and %> is server side code.

其他的变种也快捷方式:

The other variants are also shortcuts:


  • &LT;%@%GT; 是一个页面directrive

  • &LT;%=%GT; 是短期的的Response.Write

  • &LT;%:%&GT; 是短期的的Response.Write ,添加HTML编码(与介绍。 NET 4.0)

  • &LT;%#%&GT; 是有约束力的前pression

  • <%@%> is a page directrive
  • <%=%> is short for Response.Write
  • <%:%> is short for Response.Write, adding html encoding (introduced with .NET 4.0)
  • <%#%> is a binding expression

本页面是一个很好的参考这些。

This page is a good reference to all these.

这篇关于如何嵌入code块在ASP.NET网页中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆