Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ClaveUsuarioControl.ascx.vb" Inherits="WebApplication1.ClaveUsuarioControl" %>
  2. <style type="text/css">
  3. .auto-style1 {
  4. width: 100%;
  5. }
  6. </style>
  7. <script type="text/javascript">
  8. $(function () {
  9. $.updatePanelLoaded(function (id, PostBackPartial) {
  10. switch (id) {
  11. case 'ClaveUpdatePanel':
  12. $('#PasswordTextBox').on({
  13. KeyEnter: function (event) {
  14. if (event) {
  15. alert("Tiene que dar click en el botón Eliminar");
  16. } else {
  17. Clave_Aceptar();
  18. }
  19. },
  20. });
  21. break;
  22. }
  23. });
  24. });
  25.  
  26. function Clave_Aceptar() {
  27. // smiranda - se deja con ==
  28. if ($('#PasswordTextBox').val().trim() == $('#AccesoHidden').val().trim()) {
  29. clave = $('#PasswordTextBox').val().trim();
  30. //$('#ClaveDiv').dialog("close");
  31. } else {
  32. alert('Password incorrecto');
  33. }
  34. };
  35.  
  36. </script>
  37.  
  38. <asp:UpdatePanel ID="ClaveUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False" ClientIDMode="Static" >
  39. <ContentTemplate>
  40. <table class="auto-style1">
  41. <tr>
  42. <td>Supervisor: </td>
  43. <td>
  44. <asp:Label ID="AccionLabel" runat="server" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Width="200px"></asp:Label>
  45. <input id="Id_ClaveHidden" type="hidden" runat="server" clientidmode="Static" />
  46. </td>
  47. </tr>
  48. <tr>
  49. <td>Password: </td>
  50. <td>
  51. <asp:TextBox ID="PasswordTextBox" runat="server" Width="200px" ClientIDMode="Static" AutoCompleteType="Disabled" TextMode="Password" onkeypress="if (event.keyCode==13) return false;"></asp:TextBox>
  52.  
  53. <input id="AccesoHidden" type="hidden" runat="server" clientidmode="Static" />
  54. </td>
  55. </tr>
  56. </table>
  57. </ContentTemplate>
  58. <Triggers>
  59. <asp:AsyncPostBackTrigger ControlID="ClaveButton" EventName="Click" />
  60. </Triggers>
  61. </asp:UpdatePanel>
  62. <asp:Button ID="ClaveButton" runat="server" Text="Button" ClientIDMode="Static" CssClass="ocultaBoton" />
  63.  
  64. function MostrarClave() {
  65. $('#ClaveDiv').dialog({
  66. autoOpen: true,
  67. width: 350,
  68. height: 370,
  69. title: 'Clave de Autorización',
  70. modal: true,
  71. appendTo: 'form',
  72. closeOnEscape: false,
  73. open: function (event, ui) {
  74. RevisarBloqueos();
  75. if ($('#Id_ClaveHidden').val() != '4') {
  76. $('#Id_ClaveHidden').val('4');
  77. $('#ClaveButton').Click();
  78. }
  79. },
  80.  
  81. //activa los descuentos x productos Clave_Aceptar //
  82. buttons: {
  83. //"Descuento": function () { $smiranda - se comenta para que no aparesca el boton
  84. // $(this).dialog("close");
  85. // Clave_Aceptar();
  86. //},
  87. //"Cancelar": function () {
  88. // $('#PasswordTextBox').val('');
  89. // $(this).dialog("close");
  90. //},
  91. "Eliminar": function (event) {
  92. RevisarBloqueos();
  93. if ($('#PasswordTextBox').val().trim() == ""){
  94. alert("Debe Ingresar Contraseña");
  95. } else {
  96. if ($('#PasswordTextBox').val().trim() == $('#AccesoHidden').val().trim()) {
  97. Clave_Aceptar();
  98. EditarItem();
  99. $('#EliminarLinkButton').Click();
  100. $(this).dialog("close");
  101. } else {
  102. alert("Clave Incorrecta!");
  103. }
  104.  
  105. }
  106.  
  107.  
  108.  
  109.  
  110. //$('#EliminarLinkButton').Click(); //smiranda para eliminar el click
  111. }
  112. },
  113. close: function (event, ui) {
  114.  
  115.  
  116.  
  117. $('#PasswordTextBox').val('');
  118.  
  119. }
  120. }).css("font-family", "null");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement