我对我的项目的表单发布操作有问题。这些是我的代码:
SiparisViewModel:
public int? en_x { get; set; }
public int? boy_y { get; set; }
public int? adet_z { get; set; }
OlcuGirisi.cshtml
<div class="col-sm">
<input asp-for="en_x" class = "form-control" placeholder = "Genişlik" id = "Genislik" autocomplete = "off" BackColor = "#FFE3AA" onfocus = "onEnterGenislik()" onblur = "onLeaveGenislik()" onkeypress = "return isNumberKeyGenislik(event,this);"/>
</div>
<div class="col-sm">
<input asp-for="boy_y" class="form-control" placeholder="Yükseklik" id="Yukseklik" autocomplete="off" BackColor="#FFE3AA" onfocus="onEnterYukseklik()" onblur="onLeaveYukseklik()" onkeypress="return isNumberKeyYukseklik(event,this);" />
</div>
<div class="col-sm">
<input asp-for="adet_z" class="form-control" placeholder="Adet" id="Adet" autocomplete="off" BackColor="#FFE3AA" onfocus="onEnterAdet(); myFunction(this)" onblur="onLeaveAdet()" onkeypress="return isNumberKeyAdet(event,this);" />
</div>
但是当我发布它时,第一个输入值进入控制器,但其他输入值变为空。当我单击提交按钮时,所有输入肯定都有值,但我检查了所有内容,为什么会这样?
错误:
System.Data.SqlClient.SqlException:'参数化查询'(@siparisno int,@stokkodu nvarchar(5),@stokid int,@stokaciklamas'需要参数'@boy_y',但未提供。'