I haven't seen this brought up yet (only in some obscure v5 post that was never answered) but what about EditorTemplates. In MVC they live under Views\Shared\EditorTemplates. I've tried to use them but nothing... I'm still new to MVC and Umbraco + MVC but this is something that seems like it would come in handy!
MVC EditorTemplates
I haven't seen this brought up yet (only in some obscure v5 post that was never answered) but what about EditorTemplates. In MVC they live under Views\Shared\EditorTemplates. I've tried to use them but nothing... I'm still new to MVC and Umbraco + MVC but this is something that seems like it would come in handy!
Edit to add:
@using (Html.BeginUmbracoForm<GD.Umbraco.Controllers.FormsController>("Newsletter"))
{
@Html.EditorFor(x=>Model)
<input type="submit" />
}
Would ideally produce my templated Textbox from Views\Shared\EditorTemplates\String.cshtml
Stackoverflow I used to do this : http://stackoverflow.com/questions/5824124/html5-placeholders-with-net-mvc-3-razor-editorfor-extension
Well do I have egg on my face.... It DOES work!
My model looked like this:
public class NewsletterModel
{
[Required]
[EmailAddress]
[Display(Prompt = "Email Address")]
public string Email { get; set; }
}
Having the Attribute [EmailAddress] caused a different Editor Template to be called. Once I removed it the proper template went through!
Sorry! Hopefully this helps someone out though! Not an Umbraco issue so if I need to delete it, I will.
is working on a reply...