<% ... %>
– Code Block
-
Executes C# code but does not render any output to the page.
-
Useful for logic (e.g., declaring variables, loops).
<%= ... %>
– Output (Escaped)
-
Evaluates the expression and writes the result to the page.
-
The output is HTML-encoded (i.e., special characters are escaped).
3. <%- ... %>
– Output (Unescaped)
-
Writes the result to the page without HTML encoding.
Comments
Post a Comment