views:

38

answers:

2

<%= %> I know that this means Response.Write but what is the meaning of ":" sign?

+4  A: 

New <%: %> Syntax for HTML Encoding Output in ASP.NET 4 (and ASP.NET MVC 2)

desco
Or to put it simply, it HTML encodes the result of the expression.
slugster
A: 

<%:%> is like <%=Server.HtmlEncode()%>, and was introduced in ASP.NET 4.0. In addition to outputting, it also HtmlEncodes the output, to avoid most simple cases of XSS.

The whole thing is a shortcut to:

<script language="vbscript" runat="server">
    Response.Write(Server.HtmlEncode()))
</script>
Oded