@inherits Umbraco.Web.Mvc.UmbracoViewPage<Namespace.Models.SAMLSSOService_IDENTITY>
@{ Layout = "SingleSignOnMaster.cshtml";}
<p>@Model.MyNewProperty is my new property</p>
Controller
public class SAMLSSOService_IDENTITYController : RenderMvcController{
public ActionResult SingleSignOn(RenderModel model)
{
var beedle = new SAMLSSOService_IDENTITY(model.Content);
beedle.MyNewProperty = "HOORAY2";
SAMLSSOService_IDENTITY model1 = new SAMLSSOService_IDENTITY(model.Content);
model1.MyNewProperty = "HOORAY1";
//trying a few options
//return View(beedle);
return CurrentTemplate(model1);
}
}
Model
public class SAMLSSOService_IDENTITY : RenderModel
{
public string MyNewProperty;
public SAMLSSOService_IDENTITY(IPublishedContent content)
: base(content)
{
}
}
DocumentType is SAMLSSOService_IDENTITY
Template is SingleSignOn
ERROR:
The model item passed into the dictionary is of type 'Umbraco.Web.Models.RenderModel', but this dictionary requires a model item of type 'Namespace.Models.SAMLSSOService_IDENTITY'.
public class SAMLSSOService_IDENTITY : RenderModel
{
public string MyNewProperty;
public SAMLSSOService_IDENTITY(IPublishedContent content) : base(content)
{
MyNewProperty = "HOORAY2";
}
}
CONTROLLER
public class SAMLSSOService_IDENTITYController : RenderMvcController
{
public ActionResult SingleSignOn(RenderModel model)
{
var beedle = new SAMLSSOService_IDENTITY(model.Content);
return CurrentTemplate(beedle);
}
}
Does this help at all? If this doesn't help, the next thing I'd try is to make 100% sure that we are hitting your SingleSignOn action in your RenderMvcController. You could try hitting breakpoints or taking the above logic and putting it in the Index method like the following.
public class SAMLSSOService_IDENTITYController : RenderMvcController
{
public ActionResult Index(RenderModel model)
{
var beedle = new SAMLSSOService_IDENTITY(model.Content);
return CurrentTemplate(beedle);
}
}
I also wonder if the problem has to do with the underscore in your controller name. Can you check on the document type alias of your document type? If the doc type alias doesn't have an underscore, the controller shouldn't either. If using the Index action doesn't help, try removing the underscore from the controller name.
Got it working (not quite sure but I removed underscore) I created a new DocType, Controller, Model and Template. For anyone else, here it is below.
DocType = SSO
Template = SSOPage
Model
public class SSO : RenderModel
{
public string MyNewProperty;
public SSO(IPublishedContent content)
: base(content)
{
MyNewProperty = "HOORAY2";
}
}
Controller
public class SSOController : RenderMvcController
{
public ActionResult SSOPage(RenderModel model)
{
var beedle = new SSO(model.Content);
return CurrentTemplate(beedle);
}
}
Template
@inherits Umbraco.Web.Mvc.UmbracoViewPage<Namespace.Models.SSO>
@{
Layout = "SingleSignOnMaster.cshtml";
}
<p>@Model.MyNewProperty is my new property</p>
RenderMvcController Fails
View
Controller
}
Model
}
DocumentType is SAMLSSOService_IDENTITY Template is SingleSignOn
ERROR: The model item passed into the dictionary is of type 'Umbraco.Web.Models.RenderModel', but this dictionary requires a model item of type 'Namespace.Models.SAMLSSOService_IDENTITY'.
Try this
MODEL
CONTROLLER
Does this help at all? If this doesn't help, the next thing I'd try is to make 100% sure that we are hitting your
SingleSignOn
action in your RenderMvcController. You could try hitting breakpoints or taking the above logic and putting it in theIndex
method like the following.I also wonder if the problem has to do with the underscore in your controller name. Can you check on the document type alias of your document type? If the doc type alias doesn't have an underscore, the controller shouldn't either. If using the
Index
action doesn't help, try removing the underscore from the controller name.Thanks Mark, I'll try this out and get back
Got it working (not quite sure but I removed underscore) I created a new DocType, Controller, Model and Template. For anyone else, here it is below.
DocType = SSO Template = SSOPage
Model
Controller
Template
is working on a reply...