У меня есть привязка основного вида к пользовательской модели с двумя частичными видами.Одно частичное представление привязывается к модели расписания, а другое - к той же пользовательской модели.
Второе частичное представление показывает нулевое значение при публикации http.
Это главный вид
@model DBS.CustomVariable
<div id="divSchedule" style="display: none" align="left">
@Html.Partial("_cron", new DBS.Schedule2())
@Html.Partial("ScheduleEditPartial" ,Model)
</div>
Модель вида такая:
namespace DBS
{
public class CustomVariable
{
public int ReportId { get; set; }
public string ReportName { get; set; }
public string ReportTypeId { get; set; }
public string TemplateLocation { get; set; }
public bool IsScheduled { get; set; }
public int ScheduleID { get; set; }
public string MailCC { get; set; }
public string MailBCC { get; set; }
public string MailSubject { get; set; }
public string MailBody { get; set; }
public string MailTo { get; set; }
public bool Status { get; set; }
public bool IsReportNameOverwrite { get; set; }
public string NamingConvention { get; set; }
public string FileAttribs { get; set; }
public string[] DirectoryName { get; set; }
public List<string> FolderName { get; set; }
public string SavePath { get; set; }
[RegularExpression("^[a-zA-Z][a-zA-Z0-9_]*$", ErrorMessage = "Please start with alphabets followed by alphanumeric or _.")]
[StringLength(20)]
public string FilePath { get; set; }
public string DefaultLocation => ConfigurationManager.AppSettings["DefaultExcelReportSavePath"];
public int ShareOption { get; set; }
public string[] station_arr { get; set; }
public string TemplateOriginalName { get; set; }
}
}
И контроллер это
[ValidateInput(false)]
[System.Web.Mvc.HttpPost]
[Authorize(Roles = "ExcelCreate")]
[SessionExpireFilter]
public ActionResult Create(FormCollection form, HttpPostedFileBase file, CustomVariable modelCustomVariable)
{......}
Iя получаю нулевые значения в настраиваемой переменной в методе контроллера.
Где я пропускаю?