Difference between special tags asp.net(asp.net特殊标签的区别)
问题描述
我现在正在开发应用程序的前端部分,我想到了一个问题.
I'm developing a front-end part of an application right now, and a question came to my mind.
asp.net特殊标签有什么区别:
What is the difference between asp.net special tags:
<%= %>
<%@ %>
<%# %>
如果存在其他特殊标签,请描述其功能.
And if exists another special tag please describe its function.
推荐答案
<%=
打印其中表达式的原始值.
此语法可能导致 XSS 漏洞,不应使用.<%=
prints the raw value of the expression within.
This syntax can cause XSS vulnerabilities and should not be used.<%:
打印和 HTML 转义其中表达式的值.<%:
prints and HTML-escapes the value of the expression within.<%#
类似于<%=
,但用于数据绑定<%#
is like<%=
, but is used for data-binding<%
执行一段代码并忽略并返回值<%
executes a block of code and ignores and return values<%@
用于Page
或Imports
等指令.<%@
is used for directives likePage
orImports
.这篇关于asp.net特殊标签的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:asp.net特殊标签的区别


基础教程推荐
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01