We tried to add a Entity model using Razor here was the syntax:
@ModelType BID.Data.Entities.PlumbingPermit
@Code
ViewData("Title") = "Index"
Layout = "~/Views/Shared/_Layout.vbhtml"
End Code
<h2>Index</h2>
@Html.EditorForModel
@ModelType BID.Data.Entities.PlumbingPermit
@Code
ViewData("Title") = "Index"
Layout = "~/Views/Shared/_Layout.vbhtml"
End Code
<h2>Index</h2>
@Html.EditorForModel
When you build you get the following error message:
Error 1 Syntax error. C:\Documents and Settings\thacker\My Documents\Visual Studio 2010\Projects\Public Works\BuildingInspectionsSystem\Source Code\BID.Web.VB\Views\Home\Index.vbhtml BID.Web.VB
if you comment out the @ModelType everything complies and displays correctly but it is not strongly typed.
We try this in C#:
@model BID.Data.Entities.PlumbingPermit
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Index</h2>
@Html.EditorForModel()
And everything worked. Is there an issue with model binding in VB?
Thanks!
Tim
View Complete Post