相关疑难解决方法(0)

ASP.NET MVC:没有为此对象定义的无参数构造函数

Server Error in '/' Application.
--------------------------------------------------------------------------------

No parameterless constructor defined for this object. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.

Source Error: 


Line 16:             HttpContext.Current.RewritePath(Request.ApplicationPath, false);
Line 17:             IHttpHandler httpHandler = new MvcHttpHandler();
Line 18:             httpHandler.ProcessRequest(HttpContext.Current);
Line 19:             HttpContext.Current.RewritePath(originalPath, false);
Line 20:         }
Run Code Online (Sandbox Code Playgroud)

我正在关注Steven Sanderson的" Pro …

asp.net-mvc invalidoperationexception

165
推荐指数
11
解决办法
23万
查看次数

为什么我从Knockout提交的内容不会绑定到我的MVC模型

我有一个淘汰模型,正在提供我的页面和保存下面的代码是客户端执行.

self.save = function() {
    var tirerun = ko.mapping.toJSON(self.data());
    $.ajax({
        type: 'post',
        url: "@Url.Action("SaveTireRunModel", "Events")",
        data: tirerun,
        success: function(result) {
            if (!result.success) {
                alert(result.error);
            } else {}
        }
    });
};
Run Code Online (Sandbox Code Playgroud)

然后它将以下JSON发布到我的服务器(来自fiddler并为简洁而裁剪) 在此输入图像描述

使用以下http请求标头

POST http://localhost:63648/Events/SaveTireRunModel HTTP/1.1
Host: localhost:63648
Connection: keep-alive
Content-Length: 1975
Origin: http://localhost:63648
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko)         Chrome/19.0.1084.56 Safari/536.5
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: */*
Referer: http://localhost:63648/Events/OutingDetails?outingID=010fd8a1-e3a5-e111-a660-f0def1589f4b
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: jstree_open=%232012%2C%23c914324c-4d9f-e111-a79b-0024e8a037d3%2C%23eb-e957-e111-9e70-d067e53b2ed6%2C%234d-c00e-e111-ad1c-0e6e17349d3e%2C%2357-c00e-e111-ad1c-0e6e17349d3e%2C%234d-c00e-e111-ad1c-0e6e17349d3e; jstree_load=; .ASPXAUTH=054DD21DC0A17DDDAAFC254500ED8D6B3299EAABF1FB647732618E956EF082880BBA0B52A59849D3362AA03EB1F27D28867B07CD8451E4E983D84365608AA145F8DF8D71C2481639E110EC31325EE27EA3281FA2EDB7AD31A744D2A9918BE6599DB97E489ED4598D2DF63C31E36E809A282CF96FFCE5ACAEF8308FEA3DF1C6DE50B2AA7299F9D9AF0C30CE867DCCA352; jstree_open=%232012%2C%233dcc4b9b-37a3-e111-a6d3-0026b99ca1da%2C%23eb-e957-e111-9e70-d067e53b2ed6%2C%2357-c00e-e111-ad1c-0e6e17349d3e%2C%23a2962e1b-45a5-e111-b9ac-f0def1589f4b; jstree_load=%2311a4611a-8851-e111-95c7-60d819fcced5%2C%23b89422a0-0d03-e011-99cb-d601d71f0fcf; jstree_select=%23010fd8a1-e3a5-e111-a660-f0def1589f4b

{"Comments":"RSTA Dwn 2 …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc json knockout-mapping-plugin knockout.js

3
推荐指数
1
解决办法
1703
查看次数