Reputation: 650
I searched all around, but could not find any reasonable explanation.
I found <%:
tag in one of the projects. It works like the <%=
tag.
I could not find any description on this tag I only found that <%:
and <%=
are the same.
So the question popped out, why could there be two different tags with same functionality? I think there should be some difference.
Could you please clarify it for me.
Thank you
Upvotes: 1
Views: 961
Reputation: 3802
<%:
Performs a HTML Encode on the string you are writing out
Scott Hanselman suggests thinking about the equals sign being closed - like a gate (side on view). He talks about it in this video
ASP.NET MVC 2: Ninja Black Belt Tips
Upvotes: 2
Reputation: 14460
<% %>
are Embedded Code Blocks
and
<%= %>
are used to
Display content from web page.
Moreover you can find all the details about ASP.NET Page Syntax from here.
Hope this helps!!
Upvotes: 1
Reputation: 286
According to this blog post it is a new feature introduced in ASP.NET 4. It is used to automatically HTML Encode the output.
I suggest to read the full blog post, to see how it works ;)
Upvotes: 0