我有一个JavaScript方法,它对控制器方法进行AJAX调用.此控制器方法是一个JsonResult方法,它将字典对象返回给我的JavaScript.但是我对这个对象做的任何事情(比如,dictionaryObject.count,dictionaryObejct [i] .value等)给了我"undefined".有关如何使用此对象的任何想法?
function MakeControllerMethodCallFunction(stringParam1, stringParam2) {
// Remove all rows from table so that table can have latest data
$('#TableModal tr').each(function (i, row) {
var $row = $(row);
$row.remove();
});
$("#TableModal thead").append("<tr><th>" + stringParam1+ " Details " + "</th></tr>");
//Resolving the server side method URL
var websitePath = GetRootWebSitePath();
var getUrl = websitePath + "/Home/GetDetails";
//Creating parameters for Ajax call
var params = "{\"ParamOne\" : \"" + stringParam1+ "\" , \"ParamTwo\" : \"" + stringParam2+ "\" }";
//AJAX Call …Run Code Online (Sandbox Code Playgroud) 我创建了一个新的类库,在其中添加了许多现有项目,以便我可以创建一个.dll引用以在多个解决方案中使用这些类。我使用 as 添加了所有项目Add Existing Project并创建了我的类库解决方案。现在我看到文件实际上并没有被复制到新的类库位置,而是作为链接存在。
如何触发副本?
我有一个 wcf 服务,现在我已对其进行了更改,以在异常发生时继续将异常编译到列表中,并在最后将此列表作为错误响应抛出。现在单个错误就可以了。我能够抛出它并获得输出。但事实证明,将列表作为错误抛出有点具有挑战性。
-到目前为止我已经尝试过:使用AggregateException。我尝试四处寻找适当的实现。到目前为止,想出了这个:
throw new AggregateException("Multiple Errors Occured", ExceptionsList)
Run Code Online (Sandbox Code Playgroud)
还,
List<CustomExceptionObject> ThrowException(List<CustomExceptionObject> ExceptionList)
{
AggregateException eggExp = new AggregateException(ExceptionList);
throw new eggExp;
}
Run Code Online (Sandbox Code Playgroud)
我使用这些方法不断收到未处理的异常错误。任何见解都值得赞赏。
更新:我不断收到的错误消息是 -
An exception of type 'System.AggregateException' occurred in XYZ.dll but was not handled in user code.
Run Code Online (Sandbox Code Playgroud)
请记住,抛出 CustomExceptionObject 的单个对象会在 SOAP UI 中抛出正确的错误响应。我似乎无法列出这些例外情况。