Diference between special tags asp.net

六月ゝ 毕业季﹏ 提交于 2019-12-01 09:37:35
  • <%= prints the raw value of the expression within.
    This syntax can cause XSS vulnerabilities and should not be used.

  • <%: 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

  • <%@ is used for directives like Page or Imports.

Check the below site Once..You will get an idea

http://naspinski.net/post/inline-aspnet-tags-sorting-them-all-out-(3c25242c-3c253d2c-3c252c-3c252c-etc).aspx

These are some useful special tags

  • <%= %> Code Render Block - For evaluate inline expressions
  • <%@ %> Directive Syntax - Usualy for linking the codebehind and a asp.net page.
  • <%# %> Data binding

You can find more information at: http://msdn.microsoft.com/en-us/library/fy30at8h(v=vs.85).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!