Posted By

elijahmanor on 07/16/09


Tagged


Versions (?)

Code Snippet


 / Published in: HTML
 

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CodeSnippet.aspx.cs" Inherits="Playground.CodeSnippet" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head id="ctlHead" runat="server">
  5. <title>Playground</title>
  6. <script src="jquery-1.3.2.min.js" type="text/javascript"></script>
  7. <script src="jquery.blockUI.js" type="text/javascript"></script>
  8. </head>
  9. <form id="ctlForm" runat="server">
  10. <asp:Button id="ctlAddContact" runat="server" Text="Add Contact" />
  11. <div id="ctlAddContactModal" style="display: none;">
  12. <h3>Add Contact</h3>
  13. <asp:Label ID="lblFirstNameCaption" runat="server" AssociatedControlID="txtFirstName" Text="First Name" />
  14. <asp:TextBox ID="txtFirstName" runat="server" />
  15. <asp:Label ID="lblLastNameCaption" runat="server" AssociatedControlID="txtLastName" Text="Last Name" />
  16. <asp:TextBox ID="txtLastName" runat="server" />
  17. <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
  18. <asp:LinkButton ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />
  19. </div>
  20. <script type="text/javascript">
  21. $(function() {
  22. $('#<%= ctlAddContact.ClientID %>').click(function(e) {
  23. e.preventDefault();
  24. $.blockUI({message: $('#ctlAddContactModal')});
  25. });
  26. $('#<%= btnCancel.ClientID %>').click(function(e) {
  27. $.unblockUI();
  28. });
  29. var btnSaveId = '<%= btnSave.ClientID %>';
  30. $('#' + btnSaveId).click(function(e) {
  31. e.preventDefault();
  32. $.unblockUI({onUnblock: function() { eval($('#' + btnSaveId).attr('href')); } });
  33. });
  34. });
  35. </script>
  36. </form>
  37. </body>
  38. </html>

Report this snippet  

You need to login to post a comment.