Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ASP Net核心/实体框架表单保存错误_C#_Entity Framework_Asp.net Core - Fatal编程技术网

C# ASP Net核心/实体框架表单保存错误

C# ASP Net核心/实体框架表单保存错误,c#,entity-framework,asp.net-core,C#,Entity Framework,Asp.net Core,我的ASP Net Core 2.1网站上有一个奇怪的错误 在特定的表中,如果保存表单,则其中一个属性已保存加号“,”图表。 例如,我打开的项(打开局部视图)具有值:“SampleString” 我确认表单(不编辑任何属性),然后项目值为:“SampleString”。 Ilo_pass的值错误 My Controller.cs: umodel.Ilo= HttpContext.Request.Form["23"].ToString(); umodel.Ilo_Pass =

我的ASP Net Core 2.1网站上有一个奇怪的错误

在特定的表中,如果保存表单,则其中一个属性已保存加号“,”图表。 例如,我打开的项(打开局部视图)具有值:“SampleString” 我确认表单(不编辑任何属性),然后项目值为:“SampleString”。
Ilo_pass
的值错误

My Controller.cs:

umodel.Ilo=         HttpContext.Request.Form["23"].ToString(); 
umodel.Ilo_Pass =   HttpContext.Request.Form["24"].ToString();// this line has the plus ',' chart
  ...
具有以下形式的局部视图:

                        ...<div class="md-form col-sm-3">
                            <i class="fas fa-lock prefix grey-text"></i>
                            <label data-error="wrong" data-success="right" for="defaultForm-pass">Ilo User ID</label>
                            <input type="text" name="23"  class="form-control validate" value="@item.Ilo_UserId">
                        </div>
                        <div class="md-form col-sm-3">
                            <i class="fas fa-lock prefix grey-text"></i>
                            <label data-error="wrong" data-success="right" >Ilo Pass</label>
                            <input type="text" name="24" class="form-control validate" value="@item.Ilo_Pass">
                        </div>...

其他属性工作得很好。你知道这个问题是怎么回事吗?

谢谢@Crowcoder的回答。
问题是,我有两个id为[24]的输入字段。

在表单上是否有另一个同名输入?omg。。。我没有想到这一点。非常感谢你!因此,问题是由同名“24”的重复html输入引起的,删除它确实解决了问题。
c.Ilo_Pass = umodel.Ilo_Pass;
...
_application.SaveChanges();