In Razor v2, we are not able to use @this inside razor code block. For example, if we use this in Razor V2 then the parser shows a parser error.
@if (this.Model.ShowAddButton)
{
@this.Html.ActionLink("Add", "Add")
}
Detail can be found here.
http://forums.asp.net/t/1844029.aspx
Comments: This is a big deal when upgrading projects from MVC 3 to 4.
@if (this.Model.ShowAddButton)
{
@this.Html.ActionLink("Add", "Add")
}
Detail can be found here.
http://forums.asp.net/t/1844029.aspx
Comments: This is a big deal when upgrading projects from MVC 3 to 4.