Safran Ali
Safran Ali

Reputation: 4497

What's the difference style of writing in .net's MVC2,MVC3 and Razor?

If anybody has written application in .net's MVC2 and MVC3, there is a change of syntax in writing a code like

<%= %>

has been replaced by

<%: %>

or

@

so this mean that:

<%= %> == <%: %>  OR <%= %> == @

are equals?

Upvotes: 2

Views: 149

Answers (1)

Yuriy Faktorovich
Yuriy Faktorovich

Reputation: 68687

<%= %>

Writes out the string exactly as is.

<%: %>

Html Encodes the string and then writes it out.

@

Html Encodes the string and then writes it out if you're using the Razor view engine.

Upvotes: 4

Related Questions