code_junkie

Sys.ArgumentUndefinedException: Value cannot be undefined

Nov 13th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
  2.  
  3. <script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script>
  4. <script src="../../Scripts/MicrosoftAjax.debug.js" type="text/javascript"></script>
  5. <script src="../../Scripts/MicrosoftMvcAjax.debug.js" type="text/javascript"></script>
  6.  
  7. <script type="text/javascript">
  8. var myView;
  9.  
  10. $(pageLoad);
  11.  
  12. function pageLoad() {
  13. myView = $create(Sys.UI.DataView, {}, {}, {}, $get("ajaxResult"));
  14. $("#callAjaxButton").click(callActionMethod);
  15. }
  16.  
  17. function callActionMethod() {
  18. $.getJSON("/Home/GetCategories", bindData);
  19. }
  20.  
  21. function bindData(data) {
  22. myView.set_data(data);
  23. }
  24.  
  25. </script>
  26.  
  27. <input type="button" id="callAjaxButton" value="ajaxCall" />
  28.  
  29. <div id="ajaxResult"></div>
  30.  
  31. </asp:Content>
  32.  
  33. <script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script>
  34. <script src="../../Scripts/MicrosoftAjax.debug.js" type="text/javascript"></script>
  35. <script src="../../Scripts/MicrosoftMvcAjax.debug.js" type="text/javascript"></script>
  36. <script src="../../Scripts/MicrosoftAjaxTemplates.debug.js" type="text/javascript"></script>
  37.  
  38. <script type="text/javascript">
  39. var myView;
  40.  
  41. Sys.Application.add_init(pageLoad);
  42.  
  43. function pageLoad() {
  44. myView = $create(Sys.UI.DataView, {}, {}, {}, $get("ajaxResult"));
  45. $("#callAjaxButton").click(callActionMethod);
  46. }
  47.  
  48. function callActionMethod() {
  49. $.getJSON("/Home/GetCategories", bindData);
  50. }
  51.  
  52. function bindData(data) {
  53. myView.set_data(data);
  54. }
  55.  
  56. </script>
  57.  
  58. <input type="button" id="callAjaxButton" value="ajaxCall" />
  59. <div id="ajaxResult"></div>
Add Comment
Please, Sign In to add comment