C# 如何修复此本地主机页可以’;在asp.net中找不到

C# 如何修复此本地主机页可以’;在asp.net中找不到,c#,asp.net,C#,Asp.net,我想从razor页面向控制器发送一个ID,获取关于该ID的信息并对其进行编辑,但出现了一个错误 我使用Ado.net技术 这是我的创业: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Micros

我想从razor页面向控制器发送一个ID,获取关于该ID的信息并对其进行编辑,但出现了一个错误

我使用Ado.net技术

这是我的创业:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Session;


namespace WebApplication7
{

public class Startup
{
    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public IConfiguration Configuration { get; }

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();
        services.AddDistributedMemoryCache();
        services.AddSession();
    }

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
            app.UseBrowserLink();
        }
        else
        {
            app.UseExceptionHandler("/Home/Error");
        }

        app.UseStaticFiles();           
        
        
        app.UseSession();

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
        });

       


    }
}
}
这是我的观点:

在此页面上,我想发送客户id以编辑操作。 在此页面上,我想发送客户id以编辑操作。 在此页面上,我想发送客户id以编辑操作。 在此页面上,我想发送客户id以编辑操作。 在此页面上,我想发送客户id以编辑操作。 在此页面上,我想发送客户id以编辑操作。 在此页面上,我想发送客户id以编辑操作

@model IEnumerable<WebApplication7.Models.Register>

@{
    ViewData["Title"] = "reglis";
}

<h2>reglis</h2>

<p>
    <a asp-action="Create">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
                <th hidden>
                    @Html.DisplayNameFor(model => model.customer_id)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.customer_fname)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.customer_lname)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.customer_NationalCode)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.user_name)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.password)
                </th>
                <th hidden>
                    @Html.DisplayNameFor(model => model.Confirmpassword)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Email)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Gender)
                </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
        <tr>
            <td hidden>
                @Html.DisplayFor(modelItem => item.customer_id)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.customer_fname)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.customer_lname)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.customer_NationalCode)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.user_name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.password)
            </td>
            <td hidden>
                @Html.DisplayFor(modelItem => item.Confirmpassword)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Email)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Gender)
            </td>
            <td>
                @*@Html.ActionLink("Edit", "Edit", new {  id=item.customer_id  })*@ @*|
                @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
                @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })*@
                @*<a asp-controller="RegisterController1" asp-action="Edit" asp-route-id="@item.customer_id">Edit</a>*@
                <a href="/RegisterController1/Edit/id=@item.customer_id">Edit</a>
            </td>
        </tr>
}
    </tbody>
</table>

欢迎任何回复。

什么是错误?是ASP.NET核心MVC吗?如果是,请查看此项
public IActionResult Edit(int? customer_id)
        {
        
        if (customer_id == null)
        {
            return NotFound();
        }

        Register Rg = new Register();

        Rg = RgEdit.GetRegisterByID(customer_id);

        if (Rg == null)
        {
            return NotFound();
        }
        return View(Rg);
    }


    [HttpPost]       
    public IActionResult Edit(int? customer_id , [Bind] Register Reg)
    {
        if(customer_id == null)
        {
            return NotFound();
        }

        if(ModelState.IsValid)
        {
            RgEdit.GetRegister(Reg);
            return RedirectToAction("reglis");
        }
        
        return View();
    }