Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public interface IUserTagService
  2. {
  3. IList<string> GetUserTags();
  4. }
  5.  
  6. @inject IUserTagService userTagService;
  7.  
  8. <script>
  9. $(function() {
  10. var availableTags = @Json.Serialize(userTagService.GetUserTags());
  11. $("#tags").autocomplete({
  12. source: availableTags
  13. });
  14. });
  15. </script>
  16.  
  17. $(function () {
  18.  
  19. $.getJSON("@Url.Action("GetItems")", function (json) {
  20. $( "#tags" ).autocomplete({
  21. source: json
  22. });
  23. });
  24.  
  25. })
  26.  
  27. public JsonResult GetItems()
  28. {
  29. var list = new List<string>() {"ActionScript","AppleScript"};
  30. return new JsonResult(list);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement