I have an ajax method to retrieve a partial view based on a filter criteria using GET. However, it seems that I'm not able to pass in more than one parameter unless their all primitive types. No errors are thrown, just are passed in as null.
$.ajax({
cache: false,
type: "GET",
dataType: 'json',
contentType: 'application/json, charset=utf-8',
url: '/DataManagement/GetDataPartialView',
data: { configFilter : filter, Name: "SomeValue"},
success: function (data) {
$('#divManagement').html(data);
},
error: function (xhr, ajaxOptions, thrownError) {
alert('Failed...');
}
});
Controller
[HttpGet]
public ActionResult GetDataPartialView(ConfigFilter configFilter, string Name)
{
....
return PartialView("_DataPartialView.tmpl", model);
}
Model
public class ConfigFilter
{
public string ConnectionString { get; set; }
public string UserId { get; set; }
public string AppKey { get; set; }
}
if I pass either, it works... But I need to pass in both parameters.