Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ClaveUsuarioControl.ascx.vb" Inherits="WebApplication1.ClaveUsuarioControl" %>
- <style type="text/css">
- .auto-style1 {
- width: 100%;
- }
- </style>
- <script type="text/javascript">
- $(function () {
- $.updatePanelLoaded(function (id, PostBackPartial) {
- switch (id) {
- case 'ClaveUpdatePanel':
- $('#PasswordTextBox').on({
- KeyEnter: function (event) {
- if (event) {
- alert("Tiene que dar click en el botón Eliminar");
- } else {
- Clave_Aceptar();
- }
- },
- });
- break;
- }
- });
- });
- function Clave_Aceptar() {
- // smiranda - se deja con ==
- if ($('#PasswordTextBox').val().trim() == $('#AccesoHidden').val().trim()) {
- clave = $('#PasswordTextBox').val().trim();
- //$('#ClaveDiv').dialog("close");
- } else {
- alert('Password incorrecto');
- }
- };
- </script>
- <asp:UpdatePanel ID="ClaveUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False" ClientIDMode="Static" >
- <ContentTemplate>
- <table class="auto-style1">
- <tr>
- <td>Supervisor: </td>
- <td>
- <asp:Label ID="AccionLabel" runat="server" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Width="200px"></asp:Label>
- <input id="Id_ClaveHidden" type="hidden" runat="server" clientidmode="Static" />
- </td>
- </tr>
- <tr>
- <td>Password: </td>
- <td>
- <asp:TextBox ID="PasswordTextBox" runat="server" Width="200px" ClientIDMode="Static" AutoCompleteType="Disabled" TextMode="Password" onkeypress="if (event.keyCode==13) return false;"></asp:TextBox>
- <input id="AccesoHidden" type="hidden" runat="server" clientidmode="Static" />
- </td>
- </tr>
- </table>
- </ContentTemplate>
- <Triggers>
- <asp:AsyncPostBackTrigger ControlID="ClaveButton" EventName="Click" />
- </Triggers>
- </asp:UpdatePanel>
- <asp:Button ID="ClaveButton" runat="server" Text="Button" ClientIDMode="Static" CssClass="ocultaBoton" />
- function MostrarClave() {
- $('#ClaveDiv').dialog({
- autoOpen: true,
- width: 350,
- height: 370,
- title: 'Clave de Autorización',
- modal: true,
- appendTo: 'form',
- closeOnEscape: false,
- open: function (event, ui) {
- RevisarBloqueos();
- if ($('#Id_ClaveHidden').val() != '4') {
- $('#Id_ClaveHidden').val('4');
- $('#ClaveButton').Click();
- }
- },
- //activa los descuentos x productos Clave_Aceptar //
- buttons: {
- //"Descuento": function () { $smiranda - se comenta para que no aparesca el boton
- // $(this).dialog("close");
- // Clave_Aceptar();
- //},
- //"Cancelar": function () {
- // $('#PasswordTextBox').val('');
- // $(this).dialog("close");
- //},
- "Eliminar": function (event) {
- RevisarBloqueos();
- if ($('#PasswordTextBox').val().trim() == ""){
- alert("Debe Ingresar Contraseña");
- } else {
- if ($('#PasswordTextBox').val().trim() == $('#AccesoHidden').val().trim()) {
- Clave_Aceptar();
- EditarItem();
- $('#EliminarLinkButton').Click();
- $(this).dialog("close");
- } else {
- alert("Clave Incorrecta!");
- }
- }
- //$('#EliminarLinkButton').Click(); //smiranda para eliminar el click
- }
- },
- close: function (event, ui) {
- $('#PasswordTextBox').val('');
- }
- }).css("font-family", "null");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement