在React.JS视图中未定义值ASP.NET MVC

时间:2018-09-04 15:09:44

标签: asp.net-mvc reactjs

我正在制作一个库管理系统以将书籍添加到我的数据库中。 我正在通过ASP.NET MVC进行此操作,而我的观点在REACT.JS中 我的CREATE BOOK控制器是:

<ItemGroup>
    <None Update="runtimes\linux-x64\native\SQLite.Interop.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="runtimes\osx-x64\native\SQLite.Interop.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="runtimes\win-x64\native\SQLite.Interop.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="runtimes\win-x86\native\nssm.exe">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="runtimes\win-x86\native\SQLite.Interop.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
</ItemGroup>

我在React.js中的观点如下 错误即将来临TypeError:无法读取未定义的属性“值” 我还添加了一个屏幕截图,以便更容易指出我的错误。

    public ActionResult Create()
    {
        return View();
    }
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Create([Bind(Include = "BookName,BookSerialNumber,BookAuther,BookPublisher")] Book book)
    {
        using (LibraryManagmentSystemDBEntities db = new LibraryManagmentSystemDBEntities())

            if (ModelState.IsValid)
            {
                db.Books.Add(book);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

        return View(book);
    }

The picture shows the output when i fill the form it gives the error of "value undefined"

0 个答案:

没有答案