public class Temp : Base
{
public Temp(int id)
: base(id)
{
}
[DataMember(IsRequired = true, Name = "Account Number")]
[Display(Name = "Account Number")]
[Required(ErrorMessage = "An Account Number is required")]
//reg-ex
public string AccountNumber { get; set; }
[DataMember(IsRequired = true, Name = "Supply Address Postcode")]
[Display(Name = "Supply Address Postcode")]
[Required(ErrorMessage = "A Supply Address Postcode is required")]
//postcode Regex
public string Postcode { get; set; }
[Display(Name = "Email address")]
[Required(ErrorMessage = "The email address is required")]
public string EmailAddress { get; set; }
}
however when I switch @inherits Umbraco.Web.Mvc.UmbracoViewPage
which is identical to Temp I get a
public class RegistrationViewModel : Base
{
public RegistrationViewModel(int id)
: base(id)
{
}
[DataMember(IsRequired = true, Name = "Account Number")]
[Display(Name = "Account Number")]
[Required(ErrorMessage = "The Account Number is required")]
//reg-ex
public string AccountNumber { get; set; }
[DataMember(IsRequired = true, Name = "Supply Address Postcode")]
[Display(Name = "Supply Address Postcode")]
[Required(ErrorMessage = "A Supply Address Postcode is required")]
//postcode Regex
public string Postcode { get; set; }
[Display(Name = "Email address")]
[Required(ErrorMessage = "The email address is required")]
//add validation for email address// datatype
public string EmailAddress { get; set; }
}
The model item passed into the dictionary is of type 'ww.Clientname.Logic.Model.Content.Temp', but this dictionary requires a model item of type 'ww.Clientname.Logic.Model.Content.RegistrationViewModel'.
any help normally rewarded with hugs and love and sometimes beer.
I have a Base Document type and set a load of properties
The only thing is the document type my register page inhrits from is called Temp.. because we had a bit of confusion there were a couple of registration document tyoes and I'm trying to kill the unnecessary pages and use a single layout template for reusability..
Issue with ViewPage and Model in Umbraco 7.19
I have a umbrcao 7.1.9 web site and I have form built using a view page with a model
The Model looks like this
however when I switch @inherits Umbraco.Web.Mvc.UmbracoViewPage
which is identical to Temp I get a
The model item passed into the dictionary is of type 'ww.Clientname.Logic.Model.Content.Temp', but this dictionary requires a model item of type 'ww.Clientname.Logic.Model.Content.RegistrationViewModel'.
any help normally rewarded with hugs and love and sometimes beer.
Ravi
What kind of templatepage or umbracoviewpage do you use in your master layout ?
Dave
I'm using this in my layout..
Can you inherit your layout from UmbracoTemplatePage ?
I've tried variations and that doesn't work as i don't pass the models I need to the pages..
If it works with Temp, and registrationViewModel is exactly the same except for the name.. whya should one work and the other not..
Your master layout is used by all pages. So the model can change for different pages. It is hard to tell without the whole picture
Dave
Ii have a Umbraco View Page
I have a Base Document type and set a load of properties The only thing is the document type my register page inhrits from is called Temp.. because we had a bit of confusion there were a couple of registration document tyoes and I'm trying to kill the unnecessary pages and use a single layout template for reusability..
is working on a reply...