Sunday, 25 August 2013

dojo xhrGet is not working for me

dojo xhrGet is not working for me

I have written the following code to retrieve User details from my
Controller Action method.
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);
}
});
My Controller Action method is so simple like below:
[HttpGet]
public ActionResult GetUserDetailsFromLDAP(string userName, string domain)
{
Dictionary<string, object> user =
QRProxyManager<IUsrMgmtSvc>.Execute(svc =>
svc.GetLDAPUserDetails(userName, domain));
return View("CreateUser", user);
}
I have debugged using Fiddler and I am getting the following error:
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'.
Can anybody please suggest what is the problem?

No comments:

Post a Comment