0

I pasted the sample code from here in my .cshtml file just to see if it works with hard-coded data.

For some ready, the autocomplete doesn't work when I type.

The following is the code:

<script>
$(function () {
    var availableTags = [
        "ActionScript",
        "AppleScript",
        "Asp",
        "BASIC",
        "C",
        "C++",
        "Clojure",
        "COBOL",
        "ColdFusion",
        "Erlang",
        "Fortran",
        "Groovy",
        "Haskell",
        "Java",
        "JavaScript",
        "Lisp",
        "Perl",
        "PHP",
        "Python",
        "Ruby",
        "Scala",
        "Scheme"
    ];
    $("#tags").autocomplete({
        source: availableTags
    });
});
</script>
<div class="demo">

<div class="ui-widget">
    <label for="tags">Tags: </label>
    <input id="tags">
</div>

</div><!-- End demo -->

There are other controls and tables etc after this of course.

Can anyone spot where I may be going incredibly wrong?

0

2 Answers 2

1

Try adding this to your .cshtml. It's what I use to get the intellisense working.

@if (false) { <script src="/Scripts/jquery-1.7.2-vsdoc.js" type="text/javascript"></script>  }
Sign up to request clarification or add additional context in comments.

Comments

0

This code works. You need to include:

  • jquery js
  • jquery-ui css
  • jquery-ui js

Your code example (without css): jsfiddle.net/cZYuA/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.