C# '中的服务器错误/';应用程序MVC5

C# '中的服务器错误/';应用程序MVC5,c#,asp.net-mvc,visual-studio-2013,asp.net-mvc-5,C#,Asp.net Mvc,Visual Studio 2013,Asp.net Mvc 5,我正在尝试为我的网站添加一个新视图,但是我在“/”应用程序中不断收到错误服务器错误。我的视图链接到控制器,我的路由配置文件具有正确的路径。任何帮助都将不胜感激 轮廓控制器 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Bitev2.Controllers

我正在尝试为我的网站添加一个新视图,但是我在“/”应用程序中不断收到错误服务器错误。我的视图链接到控制器,我的路由配置文件具有正确的路径。任何帮助都将不胜感激

轮廓控制器

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;

    namespace Bitev2.Controllers
    {
        public class ProfileController : Controller
        {
            //
            // GET: /Profile/
            public ActionResult Index()
            {
                return View();
            }

            //
            // GET: /Profile/Details/5
            public ActionResult Details(int id)
            {
                return View();
            }

            //
            // GET: /Profile/Create
            public ActionResult Create()
            {
                return View();
            }

            //
            // POST: /Profile/Create
            [HttpPost]
            public ActionResult Create(FormCollection collection)
            {
                try
                {
                    // TODO: Add insert logic here

                    return RedirectToAction("Index");
                }
                catch
                {
                    return View();
                }
            }

            //
            // GET: /Profile/Edit/5
            public ActionResult Edit(int id)
            {
                return View();
            }

            //
            // POST: /Profile/Edit/5
            [HttpPost]
            public ActionResult Edit(int id, FormCollection collection)
            {
                try
                {
                    // TODO: Add update logic here

                    return RedirectToAction("Index");
                }
                catch
                {
                    return View();
                }
            }

            //
            // GET: /Profile/Delete/5
            public ActionResult Delete(int id)
            {
                return View();
            }

            //
            // POST: /Profile/Delete/5
            [HttpPost]
            public ActionResult Delete(int id, FormCollection collection)
            {
                try
                {
                    // TODO: Add delete logic here

                    return RedirectToAction("Index");
                }
                catch
                {
                    return View();
                }
            }
        }
    }
纵断面图

@{
    ViewBag.Title = "Profile";
}

<h2>Profile</h2>

对于这些默认值,它应该可以工作:

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { 
        controller = "Profile", 
        action = "Index", 
        id = UrlParameter.Optional 
    });

controller=“Profile”

使用这些默认值,它应该可以工作:

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { 
        controller = "Profile", 
        action = "Index", 
        id = UrlParameter.Optional 
    });

controller=“Profile”

使用这些默认值,它应该可以工作:

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { 
        controller = "Profile", 
        action = "Index", 
        id = UrlParameter.Optional 
    });

controller=“Profile”

使用这些默认值,它应该可以工作:

routes.MapRoute(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { 
        controller = "Profile", 
        action = "Index", 
        id = UrlParameter.Optional 
    });

controller=“Profile”

目前,您的控制器结构只允许以下URL-

/profile/index
/profile/details/id
/profile/create
/profile/edit/id
/profile/delete/id
Post操作支持的URL-

/profile/create
/profile/edit/id
/profile/delete/id

您正在尝试
/profile/profile
,但它不存在。这就是为什么你会出错的原因。创建配置文件操作或尝试使用处理404错误。

目前,控制器结构只允许以下URL-

/profile/index
/profile/details/id
/profile/create
/profile/edit/id
/profile/delete/id
Post操作支持的URL-

/profile/create
/profile/edit/id
/profile/delete/id

您正在尝试
/profile/profile
,但它不存在。这就是为什么你会出错的原因。创建配置文件操作或尝试使用处理404错误。

目前,控制器结构只允许以下URL-

/profile/index
/profile/details/id
/profile/create
/profile/edit/id
/profile/delete/id
Post操作支持的URL-

/profile/create
/profile/edit/id
/profile/delete/id

您正在尝试
/profile/profile
,但它不存在。这就是为什么你会出错的原因。创建配置文件操作或尝试使用处理404错误。

目前,控制器结构只允许以下URL-

/profile/index
/profile/details/id
/profile/create
/profile/edit/id
/profile/delete/id
Post操作支持的URL-

/profile/create
/profile/edit/id
/profile/delete/id

您正在尝试
/profile/profile
,但它不存在。这就是为什么你会出错的原因。创建配置文件操作或尝试使用处理404错误。

对于哪个URL,您会收到此错误?你们能分享那个URL吗?你们有家庭控制器吗?我想,你们必须在运行时输入id,或者输入你们正在使用的身份验证。签入web.config文件。是的,我有一个主控制器。我得到错误的url是@user3229621。您的控制器中没有“Profile”操作方法。对于哪个url,您得到此错误?你们能分享那个URL吗?你们有家庭控制器吗?我想,你们必须在运行时输入id,或者输入你们正在使用的身份验证。签入web.config文件。是的,我有一个主控制器。我得到错误的url是@user3229621。您的控制器中没有“Profile”操作方法。对于哪个url,您得到此错误?你们能分享那个URL吗?你们有家庭控制器吗?我想,你们必须在运行时输入id,或者输入你们正在使用的身份验证。签入web.config文件。是的,我有一个主控制器。我得到错误的url是@user3229621。您的控制器中没有“Profile”操作方法。对于哪个url,您得到此错误?你们能分享那个URL吗?你们有家庭控制器吗?我想,你们必须在运行时输入id,或者输入你们正在使用的身份验证。签入web.config文件。是的,我有一个主控制器。我得到错误的url是@user3229621。您的控制器中没有“Profile”操作方法。