I can not send data to MVC controller using YAHOO connect library.
Parameters query and filter are NULL. Where is the problem?
// --- JavaScript --- //
var callbacks = {
// Successful XHR response handler
success: function (o) {
var messages = [];
// Use the JSON Utility to parse the data returned from the server
try {
messages = YAHOO.lang.JSON.parse(o.responseText);
}
catch (x) {
alert("JSON Parse failed!");
return;
}
handleSearchResult(messages, query, filter);
},
argument: { query: "flowers", filter: "home" }
};
// Make the call to the server for JSON data
YAHOO.util.Connect.asyncRequest("GET", "Search/GetTopics", callbacks);
// --- C# --- //
//Controller
[AcceptVerbs(HttpVerbs.Get)]
public JsonResult GetTopics(string query, string filter)
{
// query and filter are NULL <- problem here //
// ...do my stuff... //
return Json(Search(query, filter), JsonRequestBehavior.AllowGet);
}
Thank you! :)