I am trying to call an external web api with the autocomplete but can't seem to pass the autocomplete value as I need to. I need to pass the value at the end of the URL like: https://webapiurl/api/{value} . The farthest I got is passing the value but as a querystring parameter (https://webapiurl/api?name=value), this doesn't work, I get a 404 error. How can I concatenate the value at the end of the URL?
@(Html.Kendo().AutoComplete().Name("auto")
.DataTextField("Name")
.Filter("contains")
.MinLength(4)
.DataSource(source =>
{
source.Read(r =>
{
r.Url("https://webapiurl/api")
.Data("onAdditionalData");
})
.ServerFiltering(false);
})
)
<script>
function onAdditionalData() {
return {
name: $("#auto").val()
};
}
</script>