Visualizzazione dei risultati da 1 a 10 su 37

Discussione: Validatori

Visualizzazione discussione

  1. #13
    Utente di HTML.it L'avatar di supermac
    Registrato dal
    Jun 2001
    Messaggi
    1,881
    "Sob sigh sniff me misero, me tapino,..." (Cit.)
    Speravo di averla fatta franca ma ora mi trovo una pagina dove devo far convivere validazioni e estensioni ajax perciò lo scriptmanager mi tocca tenermelo e le validazioni non vanno... metto un po' di codice:

    codice:
    <%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/_FLINK.Master" CodeBehind="nuovoordine.aspx.vb" Inherits="FLINK.nuovoordine" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="row">
            ...
        </div>
        <div class="row">
        <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
            <asp:View ID="inserimento" runat="server">
                <h2 class="form-signin-heading"><asp:Label ID="Label1" runat="server" Text="Inserimento nuovo ordine"></asp:Label></h2>
                
                <asp:HiddenField ID="HiddenField1" runat="server" />
                <asp:TextBox ID="sceltacli" runat="server" Width="400px" AutoPostBack="True" OnTextChanged="TextBox1_TextChanged" placeholder="cerca un cliente" ></asp:TextBox>
                <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="sceltacli" ServiceMethod="SearchCustomers" 
        MinimumPrefixLength="2" CompletionInterval="100" EnableCaching="false" CompletionSetCount="10" FirstRowSelected = "false"></cc1:AutoCompleteExtender>
                
                <asp:Button ID="Button3" runat="server" Text="Nuovo cliente" OnClick="nuovocli" />
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" Cssclass="alert alert-danger" role="alert"  ValidationGroup="new" />
    
                <asp:PlaceHolder ID="PlaceHolder1" runat="server" Visible="false">
                    ....
                </asp:PlaceHolder>
                
                <asp:FormView ID="headform" runat="server" DataKeyNames="an_ID" DefaultMode="Insert" DataSourceID="sqlNuoviCli" Width="100%" BackColor="White" Visible="false">
                    <InsertItemTemplate>
                        <table class="table">
                        <tr>
                            <td style="width:15%;"><b>Rag.Sociale *</b></td>
                           <td colspan="5"><asp:textbox ID="ntb_descr1" runat="server" Text='<%# Bind("an_descr1")  %>' Width="90%" ValidationGroup="new" MaxLength="50" ></asp:textbox>
                               <asp:RequiredFieldValidator ID="rf_ntb_descr1" runat="server" ErrorMessage="Rag.Sociale è richiesto" ControlToValidate="ntb_descr1" Visible="false" ValidationGroup="new"></asp:RequiredFieldValidator>
                               <asp:textbox ID="ntb_conto" runat="server" Text='<%# Bind("an_ID")  %>' ReadOnly="true" ValidationGroup="new" Visible="false" ></asp:textbox>
                           </td>
                        </tr>
                        <tr>
                            <td><b>Indirizzo *</b></td>
                           <td colspan="5"><asp:textbox ID="ntb_indirizzo" runat="server" Text='<%# Bind("an_indir")  %>' Width="90%" ValidationGroup="new" MaxLength="70" ></asp:textbox>
                               <asp:RequiredFieldValidator ID="rf_ntb_indirizzo" runat="server" ErrorMessage="Indirizzo è richiesto" ControlToValidate="ntb_indirizzo" Visible="false" ValidationGroup="new"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td style="width:15%;">Città *</td>
                           <td style="width:35%;"><asp:textbox ID="ntb_citta" runat="server" Text='<%# Bind("an_citta")  %>' Width="90%" ValidationGroup="new" MaxLength="50" ></asp:textbox>
                               <asp:RequiredFieldValidator ID="rf_ntb_citta" runat="server" ErrorMessage="Città è richiesto" ControlToValidate="ntb_citta" Visible="false" ValidationGroup="new"></asp:RequiredFieldValidator></td>
                             <td style="width:5%;">CAP *</td>
                           <td style="width:15%;"><asp:textbox ID="ntb_cap" runat="server" Text='<%# Bind("an_CAP")  %>' ValidationGroup="new" MaxLength="9" ></asp:textbox>
                               <asp:RequiredFieldValidator ID="rf_ntb_cap" runat="server" ErrorMessage="CAP è richiesto" ControlToValidate="ntb_cap" Visible="false" ValidationGroup="new"></asp:RequiredFieldValidator></td>
                        
                            <td style="width:10%;">Provincia *</td>
                           <td style="width:20%;"><asp:textbox ID="ntb_prov" runat="server" Text='<%# Bind("an_prov")  %>' ValidationGroup="new" MaxLength="2" ></asp:textbox>
                               <asp:RequiredFieldValidator ID="rf_ntb_prov" runat="server" ErrorMessage="Provincia è richiesto" ControlToValidate="ntb_prov" Visible="false" ValidationGroup="new"></asp:RequiredFieldValidator></td>
                        </tr>
                        <tr>
                            <td>Riferimento</td>
                           <td colspan="5"><asp:textbox ID="ntb_contatt" runat="server" Text='<%# Bind("an_contatt")  %>' Width="90%" ValidationGroup="new" MaxLength="30"></asp:textbox></td>
                        </tr>
                        <tr>
                            <td>Telefono</td>
                            <td><asp:textbox ID="ntb_telefono" runat="server" Text='<%# Bind("an_telef")  %>' Width="90%" ValidationGroup="new"  MaxLength="18" ></asp:textbox>
                               <asp:RequiredFieldValidator ID="re_ntb_telefono" runat="server" ErrorMessage="Telefono è richiesto" ControlToValidate="ntb_telefono" Visible="false" ValidationGroup="new"></asp:RequiredFieldValidator></td>
                               <td>Email *</td>
                           <td colspan="3"><asp:textbox ID="ntb_email" runat="server" Text='<%# Bind("an_email")  %>' Width="90%" ValidationGroup="new"  MaxLength="100" ></asp:textbox>
                               <asp:RequiredFieldValidator ID="re_ntb_email" runat="server" ErrorMessage="Email è richiesto" ControlToValidate="ntb_email" Visible="false" ValidationGroup="new"></asp:RequiredFieldValidator>
                               <asp:RegularExpressionValidator ID="regmailtb" ValidationExpression="...." runat="server" ErrorMessage="E' richiesta una email valida" controltovalidate="ntb_email" ValidationGroup="new"></asp:RegularExpressionValidator>
                           </td>
                        </tr>
                        <tr>
                            <td>Cod.Fiscale</td>
                           <td ><asp:textbox ID="ntb_codfis" runat="server" Text='<%# Bind("an_codfis")  %>' Width="90%" ValidationGroup="new" MaxLength="16" ></asp:textbox></td>
                            <td>P.IVA *</td>
                           <td colspan="3"><asp:textbox ID="ntb_pariva" runat="server" Text='<%# Bind("an_pariva")  %>' Width="90%" ValidationGroup="new" MaxLength="11" ></asp:textbox>
                               <asp:RequiredFieldValidator ID="re_ntb_pariva" runat="server" ErrorMessage="Partita IVA è richiesto" ControlToValidate="ntb_pariva" Visible="false" ValidationGroup="new"></asp:RequiredFieldValidator></td>
                        </tr>
                        
                        <tr>
                            <td></td>
                            <td colspan="5">
                                <asp:Button ID="Button1" runat="server" CommandName="insert" Text="Salva nuovo cliente" CausesValidation="true" CssClass="btn btn-default" ValidationGroup="new" />
                                <asp:Button ID="Button2" runat="server" CommandName="cancel" Text="Annulla" CausesValidation="false" CssClass="btn btn-default" onclientclick="return confirm('Confermi l\'annullamento delle modifiche in corso?') ;" />
                            </td>
                        </tr>
                    </table>
                    </InsertItemTemplate>
    
                    <ItemTemplate></ItemTemplate>
    
                </asp:FormView>
                <br />
                <!--<div class="panel">-->
                        <div id="accordion" class="panel-group" role="tablist">
    
                            <asp:Repeater ID="articoli" runat="server">
                                <ItemTemplate>
                                    <!-- per ogni articolo -->
                                    <div class="panel panel-default">
                                        <div class="panel-heading">
                                            <h4 class="panel-title">
                                                <a href="#<%# Replace(Eval("arr_codroot"), ".", "§") %>" data-parent="#accordion" data-toggle="collapse" class="accordion-toggle">
                                                    <%# Eval("arr_codroot") %> - <%# Eval("arr_descr") %> 
                                                </a>
                                            </h4>
                                        </div>
    
                                        <div class="panel-collapse collapse" id="<%# Replace(Eval("arr_codroot"), ".", "§") %>" style="height: 0px;">
                                            <div class="panel-body">
                                                <!-- per ogni variante  fare uno dei seguenti -->
    
                                                <asp:Repeater ID="subrighe" runat="server">
                                                    <HeaderTemplate>
                                                        <table style="width:100%;">
                                                            <tr style="font-weight:bold;">
                                                                ....
                                                            </tr>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                      
                                                            <tr style="border-bottom:1px solid #DEDEDE;">
                                                                ......
                                                            </tr>
          
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        </table>
                                                    </FooterTemplate>
                                                </asp:Repeater>
                                                <!-- fine per ogni variante -->
    
                                            </div>
                                        </div>
                                    </div>
                                    <!-- fine per ogni articolo -->
    
                                </ItemTemplate>
                            </asp:Repeater>
    
                            <div>
    
                            </div>
                            
    
    
                        </div>
                   <!-- </div>-->
                
                 <asp:HiddenField ID="PaneName" runat="server" />
                <script type="text/javascript">
                    /* $(function() {
                            var paneName = $("[id*=PaneName]").val() != "" ? $("[id*=PaneName]").val() : "collapseOne";
          
                            //Remove the previous selected Pane.
                            $("#accordion .in").removeClass("in");
          
                            //Set the selected Pane.
                            $("#" + paneName).collapse("show");
          
                            //When Pane is clicked, save the ID to the Hidden Field.
                            $(".panel-heading a").click(function () {
                                $("[id*=PaneName]").val($(this).attr("href").replace("#", ""));
                            });
                        });*/
                </script>
            </asp:View>
    
    
            <asp:View ID="riepilogo" runat="server">
                ....
            </asp:View>
        </asp:MultiView>
        </div>
    </asp:Content>
    Ultima modifica di supermac; 18-07-2016 a 09:19
    W la Ferari effetrenavenave!
    il computer è un somaro veloce! (neanche tanto ndr)

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.