Advertisement
Guest User

Menu

a guest
Dec 22nd, 2010
1,227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. $(document).ready(function() {
  2.  
  3. $('#btn_<%=UserStuff.tag %>').click(function() {
  4.  
  5. var value = $('#<%#Eval("tag") %>twink').val();
  6. something(value);
  7. });
  8. });
  9.  
  10.  
  11. function something(theval) {
  12.  
  13. alert(theval);
  14.  
  15. $.ajax({
  16. type: "POST",
  17. url: "/Default.aspx/MyMethod?something=" + theval,
  18. data: "{}",
  19. contentType: "application/json; charset=utf-8",
  20. dataType: "json",
  21. success: function(msg) {
  22. alert(msg);
  23. }
  24. });
  25. }
  26.  
  27.  
  28.  
  29. -- my c# method is:
  30.  
  31.  
  32. public JsonResult MyMethod(string something)
  33. {
  34. JsonResult ret = new JsonResult();
  35.  
  36. return ret;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement