Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, how do I include the following keywords within my view page,
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @model Models.Employees
Error Parser Error Message: The 'inherits' keyword is not allowed when a 'model' keyword is used.
code below;
@{ Layout = "WebBase.cshtml"; }
@{ Html.RenderAction("Create", "Applicants"); }
Hi Tom,
Use this:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<Models.Employees>
Regards,
Tim
Receiving error;
Compiler Error Message: CS0311: The type Models.Employees.' cannot be used as type parameter 'TContent' in the generic type or method 'Umbraco.Web.Mvc.UmbracoTemplatePage
Hi Tom
Try this:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.Employees> @using ContentModels = Umbraco.Web.PublishedContentModels;
Hi Alex, receiving error
Name Employees does not exist in the namespace Umbraco.Web.PublishedContentModels(are you missing an assembly
Tom, what is Employees? Is it doctype or custom model?
Employee is a table from the Entity. I have used Entity Framework to model the data from the database.
I think I need to include the ref @model.Models.Employees to access the data and @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
I'm just trying to access the data from the View like
<div class="form-group"> @Html.LabelFor(model => model.Forename, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @Html.EditorFor(model => model.Forename, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Forename, "", new { @class = "text-danger" }) </div> </div>
Yes, definitely you have to include @model.Models.Employees
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
inherits' keyword is not allowed when a 'model' keyword is used.
Hi, how do I include the following keywords within my view page,
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @model Models.Employees
Error Parser Error Message: The 'inherits' keyword is not allowed when a 'model' keyword is used.
code below;
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @model Models.Employees
@{ Layout = "WebBase.cshtml"; }
@{ Html.RenderAction("Create", "Applicants"); }
Hi Tom,
Use this:
Regards,
Tim
Receiving error;
Compiler Error Message: CS0311: The type Models.Employees.' cannot be used as type parameter 'TContent' in the generic type or method 'Umbraco.Web.Mvc.UmbracoTemplatePage
Hi Tom
Try this:
Hi Alex, receiving error
Name Employees does not exist in the namespace Umbraco.Web.PublishedContentModels(are you missing an assembly
Tom, what is Employees? Is it doctype or custom model?
Employee is a table from the Entity. I have used Entity Framework to model the data from the database.
I think I need to include the ref @model.Models.Employees to access the data and @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
I'm just trying to access the data from the View like
Yes, definitely you have to include @model.Models.Employees
is working on a reply...