I am trying to reuse a partial view form between two views (edit and create).
Inside the parent views I declare a variable called form type and I basically just want to use that value in my partial view, but it doesnt seem to work. Here s what I have so far:
Parent View
@model Models.Slide
@{
ViewBag.Title = "Edit Slide";
ViewBag.FormType = "Edit";
Layout = "~/Areas/Admin/Views/Slide/_SlideLayout.cshtml";
}
<h2>Edit Slide</h2>
@Html.Partial("_SlideForm", Model)
Partial VIew (_SlideForm)
@model Models.Slide
@using (Html.BeginForm(ViewBag.Title, "Slide", null, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
I basically just want to declare something outside of the partial view that I can use for the action method within the partial view.
Any help would be greatly apppreciated.
Thanks