I am new to MVC. Now I am learning with VS2010, ASP.NET MVC 4.
<% %>
is not working for me. It is tedious for me to use @
.
If i write large code with lot of if{}
then <%
will be useful.
Can you please help me how to write with <% %>
I need like this:
The customer id is <%= Model.Id %> <br />
The customer Code is <%= Model.CustomerCode %> <br />
<% if (Model.Amount > 100) {%>
This is a priveleged customer
<% } else{ %>
This is a normal customer
<%} %>
But I am able to use like this only:
<div>
@{
if(Model.Amount > 70000.00)
{
Response.Write("This is a Privelleged Customer"); <br />
}
else
{
Response.Write("This is a Normal Customer"); <br />
}
}
The Customer Id is: @Model.Id <br />
The Customer Name is: @Model.Code <br />
</div>