Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface IUserTagService
- {
- IList<string> GetUserTags();
- }
- @inject IUserTagService userTagService;
- <script>
- $(function() {
- var availableTags = @Json.Serialize(userTagService.GetUserTags());
- $("#tags").autocomplete({
- source: availableTags
- });
- });
- </script>
- $(function () {
- $.getJSON("@Url.Action("GetItems")", function (json) {
- $( "#tags" ).autocomplete({
- source: json
- });
- });
- })
- public JsonResult GetItems()
- {
- var list = new List<string>() {"ActionScript","AppleScript"};
- return new JsonResult(list);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement