This is a migrated thread and some comments may be shown as answers.

Cant get autocomplete wiget to register - following tutorial using asp.net mvc

0 Answers 46 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Colin
Top achievements
Rank 1
Colin asked on 08 Sep 2013, 02:47 PM
Hello,

I am working through the dojo tutorial using asp.net MVC.  I am able to see the kendo.web.min.js file, but it still doesn't properly create the autocomplete control.  Could you look at my code and see what I am doing wrong?  Thanks!

Master Layout.cshtml page:

<!DOCTYPE html>
 
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Styles/Site.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Styles/kendo.silver.min.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo.web.min.js")" type="text/javascript"></script>
</head>
<body>
    <div>
        @RenderBody()
    </div>
    <script src="@Url.Content("~/Scripts/Custom.js")" type="text/javascript"></script>
</body>
</html>
Custom.js file (where I call the auto complete wiget:

$(document).ready(function () {
    $(function () {
        $("countriesAutoComplete").kendoAutoComplete();
    });
});

.cshtml page that tries to use the autocomplete widget:

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
 
<!DOCTYPE html>
 
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
       <p>
           Country: <input id="countriesAutoComplete" class="k-input" />
       </p>
    </div>
    <script type="text/javascript" src="~/Scripts/Custom.js"></script>
</body>
</html>
When I assign the class "k-input" it doesnt change styles like it does in the tutorial.  I checked to make sure the stylesheet is being sent to the browser.

No answers yet. Maybe you can help?

Tags
AutoComplete
Asked by
Colin
Top achievements
Rank 1
Share this question
or