What is the differences in operators for render server code?
Operator: <%@
Operator: <%:
Operator: <%=
<%=
simply evaluates an expression and writes the result to the page output
<%:
is the same, but also HTML encodes the output - unless the output implements IHtmlString
<%@
is for special framework directives, e.g. <%@ Page for specifying page attributes such as the master page
<%
is for code blocks that are statements, not expressions. These will not generate page output unless you explicitly call a function that writes to the output.
<%#
is for data-binding expressions, which are evaluated when a webforms control is databound. They are therefore rarely used in MVC.
<%: html-encodes the result <%= is equal to Response.Write <%@ is an preprocessor derictive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With