I am new to Umbraco and MVC but not to Webforms. I have a partial view that works fine in an Umbraco template, but I would also like it to be available in the content rich text editor, not just in the templates.
The template calls the partial view like:
@Html.Partial("ContactForm", new Mynamespace.UmbracoCms.ContactFormModel())
Under Partial View Macro Files on the Developer tab in the Umbraco back office, I have added the .cshtml file for the partial view.
@inherits Umbraco.Web.Mvc.UmbracoViewPage<Mynamespace.UmbracoCms.ContactFormModel>
@{
Layout = null;
}
<h3>Contact Form</h3>
@using (Html.BeginUmbracoForm("SendEmail", "ContactFormSurface"))
{
<div class="formRow">
@Html.LabelFor(x => Model.Name)
@Html.EditorFor(x => Model.Name)
@Html.ValidationMessageFor(x => Model.Name)
</div>
<div class="formRow">
@Html.LabelFor(x => Model.Email)
@Html.EditorFor(x => Model.Email)
@Html.ValidationMessageFor(x => Model.Email)
</div>
<div class="formRow">
@Html.LabelFor(x => Model.Comment)
@Html.EditorFor(x => Model.Comment)
@Html.ValidationMessageFor(x => Model.Comment)
</div>
<div class="buttonRow">
<input type="submit" name="Submit"/>
</div>
}
I am obviously missing something, yet I cannot find any documentation or tutorials to accomplish what I am looking for.
Thanks for any help you can provide!