<%= just evaluates the expression and writes the result to the page output
<%: the same, but HTML encodes the output - unless the output implements IHtmlString
<%@ refers to special framework directives, for example. <% @Page for specifying page attributes such as homepage
<% is for code blocks that are statements, not expressions. They will not generate page output unless you explicitly call a function that writes to the output.
<%# refers to data binding expressions that are evaluated when web form management is a database binding. Therefore, they are rarely used in MVC.
Jonas h
source share