我的问题对你们大多数人来说可能听起来很愚蠢,但我一直在努力找出问题所在。我基本上有一个方法和一个视图(通过右键单击-> 添加视图创建)。
这是我的方法:
public ActionResult yearlyOverview(FormCollection values)
{
return View();
}
这是我的观点:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
yearlyOverview
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>yearlyOverview</h2>
</asp:Content>
我收到的错误消息来自浏览器:
Sys.ArgumentException
:Sys.ArgumentException
: 无法反序列化。数据不对应于有效的 JSON。参数名称:数据
这是母版页代码:
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<link href="../../Content/css/fullcalendar.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="page">
<div id="header">
<div id="title">
<h1>PS Administration</h1>
</div>
<div id="logindisplay">
</div>
<div id="menucontainer">
<ul id="menu">
<li><%= Html.ActionLink("Home", "Index", "Home")%></li>
<li><%= Html.ActionLink("Notices", "Index", "Notice")%></li>
<li><%= Html.ActionLink("Job Positions", "Index", "JobPosition")%></li>
</ul>
</div>
</div>
<div id="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
<div id="footer">
</div>
</div>
</div>
</body>
</html>
有人已经偶然发现了这个问题吗?