views:

314

answers:

1

Hi

I am using the autocomplete plugin but for some reason it is not getting to the controller when I start typing in the text box.

Has anyone used this? or worked with this? or got a working example? I've tried changing the url to /Referral/Get but still does not work

$("#uxSearch").tokenInput("../Referral/Get",
        {
            hintText: "Type in something",
            noResultsText: "No Results",
            searchingText: "Searching",
            classes: {
                tokenList: "token-input-list-facebook",
                token: "token-input-token-facebook",
                tokenDelete: "token-input-delete-token-facebook",
                selectedToken: "token-input-selected-token-facebook",
                highlightedToken: "token-input-highlighted-token-facebook",
                dropdown: "token-input-dropdown-facebook",
                dropdownItem: "token-input-dropdown-item-facebook",
                dropdownItem2: "token-input-dropdown-item2-facebook",
                selectedDropdownItem: "token-input-selected-dropdown-item-facebook",
                inputToken: "token-input-input-token-facebook"
            }
        });
+2  A: 

You might show us your global.asax.cs routes. Avoid using ../ in relative URLs with ASP.NET MVC. Rather use it like this with a helper method:

$("#Products").focus().autocomplete('<%=Url.Action("GetProducts", "Product") %>', { ...

(the above is from my autocomplete request)

As Zhaph said, try browsing to the URL manually through browser to see if controller actions work fine.

mare
thanks. as what Zhaph said. I'll also take your idea about the url.
kurasa