Dear,
We have tried to add autocomplete dynamically from partial view with Ajax.ActionLink, but they do not initialize, and not working.
We also managed to use different id-s on the inputs, but we standardize the name for achive out goal:
Dynamic load of partial view:
@Html.Partial("_Teszt", Model)
<div id="tobbSpecEszkoDiv">
</div>
@Ajax.ActionLink(
"Új",
"_Teszt",
"Home",
new AjaxOptions
{
UpdateTargetId = "tobbSpecEszkoDiv",
InsertionMode = InsertionMode.InsertAfter,
OnSuccess = "korteLo"
})
<script language="javascript">
function korteLo(e) {
$("input[id^='countries']").attr('name', 'countries');;
}
</script>
PartialView:
@using Kendo.Mvc.UI
@(Html.Kendo().AutoComplete()
.Name("countries"+DateTime.Now.Millisecond)
.Filter("startswith")
.Placeholder("Select country...")
.BindTo(new string[] {
"Albania",
"Andorra",
"Armenia",
"Austria",
"Azerbaijan",
"Belarus",
"Belgium",
})
.Separator(", ")
)
For further details we attached the project files.
Best regards.