Razor View and ASPx in MVC

In MVC 5 we have only one way to create View which is Razor View, file extension of razor view is ".cshtml"
But before MVC 5 we had one more option which was ASPX, now in MVC 5 ASPX has been removed and currently Razor view is available with MVC 5.

There were differences in ASPX and Razor view.
We use @{} to write dynamic code in Razor view and <% %> to write dynamic code in ASPx.

How to pass data from Controller to View:

  • ViewBag
  • ViewData
  • TempData


I will discuss about these 3 ways one by one in next blogs.

Popular posts from this blog

Calling REST APi from server side code - C#

All about SharePoint 2010 Content Type Hub

Calling ASP.Net WebMethod using jQuery AJAX