asp.netmarkupserver-tagsservertag

ASP.NET server tag with colon?


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


Solution

  • 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 ;)