Note that there are some explanatory texts on larger screens.

plurals
  1. POUmbraco 4.11 models and template inheritance
    primarykey
    data
    text
    <p>I'm new to Umbraco and MVC - can anyone help with the following?</p> <p>I have a master template (Root.cshtml) which has templates nested below it. In some of these I want to use custom models, however Root.cshtml needs access to the Umbraco helper.</p> <p>So the nested pages inherit from Umbraco.Web.Mvc.UmbracoViewPage&lt;<em>CustomModel</em>>, whilst Root.cshtml needs to inherit from something more general. </p> <p>I've tried having my custom models inherit from Umbraco.Web.Models.RenderModel however I keep being told that either my custom model does not contain a constructor that takes 0 arguments or, or if I give it one, that 'Umbraco.Web.Models.RenderModel' does not contain a constructor that takes 0 arguments</p> <p>What am I doing wrong and how should I accomplish this nesting?</p> <pre><code>namespace CRuMbraco.Web.Models { public class RegisterModel : RenderModel { [Required] [Display(Name = "Customer code")] public string CustomerCode { get; set; } [Required] [DataType(DataType.EmailAddress)] [Display(Name = "Email address")] public string Email { get; set; } [Required] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } [DataType(DataType.EmailAddress)] [Display(Name = "Confirm email")] [Compare("Password", ErrorMessage = "The e-mail and confirmation e-mail do not match.")] public string ConfirmEmail { get; set; } [Required] [Display(Name = "FirstName")] public string FirstName { get; set; } [Required] [Display(Name = "LastName")] public string LastName { get; set; } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload