code_junkie

SimpleModal breaks ASP.Net Postbacks

Nov 10th, 2011
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. btn.OnClientClick = string.Format("{0}; dlg.close();",
  2. ClientScript.GetPostBackEventReference(btn, null));
  3.  
  4. private void CloseDialog()
  5. {
  6. string script = string.Format(@"closeDialog()");
  7. ScriptManager.RegisterClientScriptBlock(this, typeof(Page), UniqueID, script, true);
  8. }
  9.  
  10. function closeDialog() {
  11. $.modal.close();
  12. }
  13.  
  14. function modalShow(dialog) {
  15.  
  16. // if the user clicks "Save" in dialog
  17. dialog.data.find('#ButtonSave').click(function(ev) {
  18. ev.preventDefault();
  19.  
  20. //Perfom validation
  21.  
  22. // close the dialog
  23. $.modal.close();
  24.  
  25. //Fire the click event of the hidden button to cause a postback
  26. dialog.data.find('#ButtonSaveTask').click();
  27. });
  28.  
  29. dialog.data.find("#ButtonCancel").click(function(ev) {
  30. ev.preventDefault();
  31. $.modal.close();
  32. });
  33. }
  34.  
  35. $('#myJQselector').modal({onClose: mynewClose});
  36.  
  37. function myNewClose (dialog)
  38.  
  39. {
  40.  
  41. dialog.close();
  42.  
  43.  
  44.  
  45.  
  46.  
  47. {appendTo:'form'}
  48.  
  49. {appendTo:'form'}
  50.  
  51. {appendTo:'form'}
  52.  
  53. {appendTo:'form'}
  54.  
  55. {appendTo:'form'}
  56.  
  57. {appendTo:'form'}
  58.  
  59. {appendTo:'form'}
  60.  
  61. {appendTo:'form'}
  62.  
  63. {appendTo:'form'}
  64.  
  65. {appendTo:'form'}
  66.  
  67. {appendTo:'form'}
  68.  
  69. {appendTo:'form'}
  70.  
  71. {appendTo:'form'}
Add Comment
Please, Sign In to add comment