Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function DeleteBook(idimg) {
  2. // idimg is a string
  3. var userConfirm = window.confirm('Are you sure?');
  4.  
  5. if (userConfirm == true) {
  6.  
  7. Session["forDelete"] = a; //doesn't work
  8. window.open('Delete.aspx');
  9. }
  10. else
  11. return false;
  12. }
  13.  
  14. Session["MySession"] = ...;
  15.  
  16. $.ajax({
  17. type: "POST",
  18. url: "Default.aspx/SetSession",
  19. data: "{MyValue:a}",
  20. contentType: "application/json; charset=utf-8",
  21. dataType: "json",
  22. success: function(msg) {
  23. // Do something interesting here.
  24. }
  25. });
  26.  
  27. public partial class Default : Page
  28. {
  29. [WebMethod]
  30. public static string SetSession(string MyValue)
  31. {
  32. Session["forDelete"] = MyValue;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement