Articles → ASP .NET MVC → View engines in asp.net MVC

View engines in asp.net MVC












ASPX view engine







Click to Enlarge



<p><% 
            
            
            if (DateTime.Now.Day == 19)
            
            
            
               {%>
               
            
            Execute code block 1
            
            
            <%}else {%>
            
            
            Execute code block 2
            
            <%} %>
</p>



Razor view engine







Click to Enlarge



<p>
        Use this area to provide additional information.
        @if (DateTime.Now.Day == 19)
        {         
	    <text>  Execute Code block 1</text>            
        }
        else
        {
    
	    <text>Execute Code block 2</text>
        }
</p>



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, June 9, 2015

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250