我正在开发一个由一些我实际上不认识的人开发的项目。我在 POST 方法上遇到问题。该模型实际上是空的。看起来模型没有填充在视图上。
public ActionResult ConfermaRistampa(int IDTitolo, Ristampa ristampa) //Ristampa is the model
{
//some code
if (ristampa.RichiestaRistampaWeb != null) //the field "RichiestaRistampaWeb" is null
{
ristampa.RichiestaRistampa = Utilities.ConverteFileInToFileUploadInfo(ristampa.RichiestaRistampaWeb, TipiDocumenti.Documento_Generico);
}
}
//this is the code of field on the Ristampa class declaration, in the set i noticed that value is null
public System.Web.HttpPostedFileBase RichiestaRistampaWeb
{
get
{
return this.RichiestaRistampaWebField;
}
set
{
if ((object.ReferenceEquals(this.RichiestaRistampaWebField, value) != true))
{
this.RichiestaRistampaWebField = value;
this.RaisePropertyChanged("RichiestaRistampaWeb");
}
}
}
这就是整个模型的定义。显然是使用 MVC 的 ASP.NET Core。我注意到模型的大多数属性在设置器上都是空的。
Cats萌萌
相关分类