We have an Issue with the Server-side filtering feature from the kendoAutoComplete. This autocomplete is contained in a html form tag. When the request is performed on the asp.net mvc endpoint the DataSourceRequest is completly empty, becuase all the values for this object are in HttpContext.Request.Form, from where the DataSourceRequestAttribute doesn't parse it from. What should we do, to get the DataSourceRequest correctly bound?
HTML Code
<form class="navbar-form" role="search" method="post" action="@Url.Action("Results","Search")">
// some other controls
<div class="input-group">
<span class="k-widget k-autocomplete k-header k-state-default myClass">
<input type="text" id="autoCompleteSearch" name="autoCompleteSearch" class="form-control" />
</span>
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
</div>
</div>
</form>
JS Code:
$('#autoCompleteSearch').kendoAutoComplete({
minLength: 1,
dataTextField: 'Caption',
dataValueField: 'Value',
filter: "contains",
dataSource: {
serverFiltering: true,
transport: {
read: {
type: "post",
dataType: "json",
url: '@Url.Action("AdvancedSearchAutoComplete_Read", "AjaxValues")?searchType=' + window.searchType
}
},
schema: {
data: "Data"
}
}
});
Server-side:
[System.Web.Mvc.HttpPost]
public JsonResult AdvancesSearchAutoComplete_Read(int searchType, [DataSourceRequest] DataSourceRequest request)
{
//...
}
Thank you in advance!