Using ASP.NET Core 2.0 Razor Pages
Currently I have a cshtml page that renders a combo/dropdown
<select asp-for="DoctorPractice.DoctorId" class="form-control" asp-items="ViewBag.Doctors"></select>
the PageModel for the view contains some code to populate the ViewBag
var doctors = _context.Doctors;
ViewData["DoctorId"] = new SelectList(doctors, "Id", "FullName");
This all works fine - however, now I wish to use the Telerik AutoComplete control because of it's nice features.
I tried this code below without success - i just get js errors.
@(Html.Kendo().AutoComplete()
.Name("doctors")
.Filter("startswith")
.Placeholder("Select doctor...")
.BindTo(ViewBag.Doctors)
)
Please can I have an example for Razor Pages using the AutoComplete control?
Thanks,