Jquery Autocomplete无法调用jquery函数

时间:2014-01-02 20:14:28

标签: jquery asp.net-mvc jquery-autocomplete

    <script type="text/javascript">
    $(function () {
        $("#txtSearch").autocomplete({
            source: '@Url.Action("getLeagues")',
            minLength: 2

        })
    });
</script>
@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>Select League to Join</h4>
        <hr />
        @Html.ValidationSummary(true)


        <div class="form-group">
            @Html.LabelFor(model => model.LeagueId, "League", new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBox("League", null, new { id = "txtSearch" }) 

问题是,它根本没有调用函数。我已正确导入所有内容,但我得到“此断点不会被击中”,我尝试更改各种内容但仍然无法调用该函数。

已修复 - 继承人 删除了自动完成文件中的渲染,只是获得了jquery UI的链接。在_Layout.cshtml中,我将@ scripts.render从正文移动到标题..那就是它......羞耻它只需要3个小时来修复:(

0 个答案:

没有答案