Exit button does not autodirect to the back page asp c #

1

Good afternoon I would like you to help me. I have made a page in asp c # for this I am working with boostrap what happens before me in my fields put required for it to require and do not register when the white texbox I put the required but now when I press exit it can not and I the required alert comes out:

This is my code asp c #

             

     <table class="TableFrm">
          <tr>
           <asp:Label ID="lblidusuario" runat="server" Visible="False"></asp:Label>
           <th >
                <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Ticket  :"></asp:Label>

           </th>
           <td  style="width:90%" colspan="3">
                <asp:Label ID="lblidregistrotareas" runat="server"></asp:Label>
               <asp:Label ID="Label10" runat="server" Text="7" Visible="False"></asp:Label>
            </td>
        </tr>

        <tr>

           <th >
                <asp:Label ID="Label4" runat="server" Font-Bold="True" Text="Fecha de Registro  :"></asp:Label>
           </th>
           <td  style="width:90%" colspan="3">
                <asp:Label ID="lblfechareg" runat="server"></asp:Label>
            </td>
        </tr>

                 <tr>
           <th class="auto-style4" >
                <asp:Label ID="Label5" runat="server" Font-Bold="True" Text="Rubro : "></asp:Label>
           </th>
           <td  style="width:20%">
                <asp:DropDownList ID="dprTarea" runat="server" Enabled="False" Height="16px" Width="162px"></asp:DropDownList>
                <asp:Label ID="lblTarea" runat="server"></asp:Label>
                     </td>

        </tr>


          <tr>

                <asp:Label ID="Label9" runat="server" Font-Bold="True" Text="Estado:" Visible="False"></asp:Label>


                <asp:Label ID="lblestado" runat="server" Visible="False"></asp:Label>

           <th class="auto-style7">
                <asp:Label ID="Label2" runat="server" Text="Agencia:"></asp:Label>
                </th>
           <td >

        <asp:DropDownList ID="dprAgencia" runat="server" Enabled="False" Height="16px" Width="162px"></asp:DropDownList>
                  <asp:Label ID="lblagencia" runat="server"></asp:Label>
                </td>

        </tr>

        <tr>
            <th   >
                <asp:Label ID="Label42" runat="server" Text="Atendido Por:"></asp:Label>
            </th>
            <td  >
                <asp:Label ID="lblatendidopor" runat="server"></asp:Label>
            </td>


        </tr>
       <tr>
            <th class="auto-style4" > 
                  <asp:Label ID="Label8" runat="server" Font-Bold="True" Text="Fecha de Vencimiento del Recibo : "></asp:Label>
             </th>
             <td  style="width:20%">
                  <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true">

                                               

                     </td>
        </tr>
       <tr>
           <th>
               <asp:Label ID="Label3" runat="server" Text="Ingrese el Monto de Pago:"></asp:Label>
           </th>

                <td class="auto-style7" >

                <asp:TextBox ID="TxtMontoPagado" runat="server" placeholder="Monto Pagado" style="width:40%" Enabled="True" required title="Ingrese el Monto" data-error-msg="Ingrese el Monto"></asp:TextBox>
                </td>

       </tr>
         <tr>
             <th>
                    <asp:Label ID="Label6" runat="server" Text="Ingrese el Numero de Recibo:"></asp:Label>
             </th>
             <td class="auto-style7">
                 <asp:TextBox ID="txtNumeroRecibo" runat="server" placeholder="Numero Recibo" style="width:40%" Enabled="True" required data-error-msg="Ingrese el Nro Recibo"></asp:TextBox>
             </td>
         </tr>
         <tr>
             <th>
                   <asp:Label ID="Label7" runat="server" Text="Ingrese la Fecha Pago Recibo :" required data-error-msg="Ingrese la Fecha de Pago Recibo"></asp:Label>
             </th>

             <td class="auto-style7">
                  <asp:TextBox ID="TxtFecha" runat="server" placeholder="Fecha" style="width:40%" Enabled="True"></asp:TextBox>
             <cc1:CalendarExtender ID="Calendar1" PopupButtonID="TxtFecha" runat="server" TargetControlID="TxtFecha" Format="dd/MM/yyyy"> </cc1:CalendarExtender> 
                  </td>
         </tr>
        <tr>
            <td colspan="4"  style="text-align:left; height:100px; vertical-align:top" class="Etiqueta">
                        <asp:Label ID="Lblsolucion" runat="server" Width="100%" CssClass="Eti_Con_Izq" ></asp:Label>
                     </td>
        </tr>

    </table>
    <table class="TableButton">

        <tr>


            <td style="width:20%">
                <asp:Button ID="BtnnoConforme" runat="server" CssClass="btn btn-danger" Text="Atender Tarea" Width="93%" Font-Bold="True" Height="31px" OnClick="BtnnoConforme_Click" />

            </td>
            <td style="width:20%">
                <asp:Button ID="BtnBuscar" runat="server" CssClass="btn btn-danger" Text="Buscar" Width="90%" Font-Bold="True" Height="31px" OnClick="BtnBuscar_Click" />
            </td>

            <td style="width:25%">
                <asp:Button ID="BtnCancelar" runat="server" CssClass="btn btn-danger" Text="Salir" Width="50%" Font-Bold="True" Height="31px" OnClick="BtnCancelar_Click" />
            </td>
             <td style="width:20%">
                <asp:Button ID="BtnActualizar" runat="server" CssClass="btn btn-danger" Text="Actualizar" Width="68%" Font-Bold="True" Height="31px" OnClick="BtnActualizar_Click" Visible="False" />
            </td>
            <td style="width:25%"></td>
            <asp:Label ID="lblErrorMsg" runat="server"></asp:Label>

       </tr>
    </table>
</div>
        </center>
    <asp:Label ID="lblidusuariologin" runat="server" Text="Label" Visible="false"></asp:Label>
</form>

This is my exit code:

  protected void BtnCancelar_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            Response.Redirect("FrmLogeo.aspx"); 

        }
    
asked by PieroDev 10.03.2017 в 19:07
source

1 answer

1

Defines the UseSubmitBehavior property of the button to false . Something like this:

<asp:Button ID="BtnCancelar" runat="server" ... UseSubmitBehavior="False" />

Part of the definition is omitted (which goes in ... ) .

I hope this helps you, regards.

    
answered by 10.03.2017 / 23:35
source