Sunday, 21 August 2016

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.

Razor View vs ASPx in MVC

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.

Next -

No comments:

Post a Comment

Dear Readers, Please post your valuable feedback in the comment section if you like this blog or if you have any suggestions. I would love to hear the same from you. Thanks