2013-08-25 59 views
0

我已经写了下面的代码来从我的Controller Action方法中检索用户详细信息。dojo xhrGet不适合我

dojo.xhrGet 
({ 
    url: "/UserManagement/GetUserDetailsFromLDAP/?userName=" + userName + "&domain=" + domain, 
    load: function (data) { 
     alert("Data: " + data); 
    }, 
    preventCache: true, 
    sync: true, 
    error: function (err) { 
     alert("Error=" + err); 
    } 
}); 

我的控制器的操作方法是如此简单象下面这样:

[HttpGet] 
public ActionResult GetUserDetailsFromLDAP(string userName, string domain) 
{ 
    Dictionary<string, object> user = QRProxyManager<IUsrMgmtSvc>.Execute(svc => svc.GetLDAPUserDetails(userName, domain)); 
    return View("CreateUser", user); 
} 

我已经使用招调试和我收到以下错误:

The model item passed into the dictionary is of type 
'System.Collections.Generic.Dictionary`2[System.String,System.Object]', 
but this dictionary requires a model item of type 
'QR.NGLMS.ServicesRef.UserSvc.User'. 

可有人请建议是什么问题?

回答

0

该标题非常具有误导性,因为它表明错误在Dojo代码中。但是,我看到的错误消息是.NET相关问题。

我可以做什么事了上下文(这是前一段时间我使用.NET技术)是一种东西在你的代码(可能是View部分)希望你有Dictionary<User>(其中UserQR.NGLMS.ServicesRef.UserSvc.User)。但是,您创建了一个对象字典。