Ciao! Ecco il codice:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="inserimento_pratica.aspx.vb" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Pagina senza titolo</title>
<link href="../../PagineProtette/stile.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="100%">
<tr>
<td colspan="3">
<asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True"
DataKeyNames="ID_Pratica" DataSourceID="SqlDataSource1" Height="50px" Width="641px" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" Font-Bold="True" Font-Overline="False" CellSpacing="2" HeaderText="Inserimento pratica" AutoGenerateRows="False">
<Fields>
<asp:BoundField DataField="ID_Pratica" HeaderText=" Numero Pratica" InsertVisible="False"
ReadOnly="True" SortExpression="ID_Pratica" />
<asp:TemplateField HeaderText="Cliente" SortExpression="ID_Contraente">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Nomecompleto" DataValueField="ID_Cliente" SelectedValue='<%# Bind("ID_Contraente") %>' AppendDataBoundItems="True" ><asp:ListItem Selected="True" Value=""> </asp:ListItem>
</asp:DropDownList><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:agenziaConnectionString %>"
SelectCommand="SELECT Cognome + Nome AS Nomecompleto, ID_Cliente FROM Clienti"></asp:SqlDataSource>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/PagineProtette/inserimento/inserimento_cliente.aspx">Nuovo cliente</asp:HyperLink>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropDownList1"
ErrorMessage="Inserire il Cliente"></asp:RequiredFieldValidator>
</EditItemTemplate>
<InsertItemTemplate><asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Nomecompleto" DataValueField="ID_Cliente" SelectedValue='<%# Bind("ID_Contraente") %>' AppendDataBoundItems="True" ><asp:ListItem Selected="True" Value=""> </asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:agenziaConnectionString %>"
SelectCommand="SELECT Cognome + Nome AS Nomecompleto, ID_Cliente FROM Clienti" ></asp:SqlDataSource>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/PagineProtette/inserimento/inserimento_cliente.aspx">Nuovo cliente</asp:HyperLink>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="DropDownList1"
ErrorMessage="Inserire il Cliente"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2"
DataTextField="Nomecompleto" DataValueField="ID_Cliente" Enabled="False" SelectedValue='<%# Bind("ID_Contraente") %>'>
</asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:agenziaConnectionString %>"
SelectCommand="SELECT Cognome + Nome AS Nomecompleto, ID_Cliente FROM Clienti"></asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Gruppo" SortExpression="ID_Gruppo">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("ID_Gruppo") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("ID_Gruppo") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Bind("ID_Gruppo") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Data Creazione" SortExpression="DataCreazione">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DataCreazione", "{0:d}") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TextBox1"
ErrorMessage="Inserire la Data di Creazione"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TextBox1"
ErrorMessage="Data di Creazione non valida" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("DataCreazione", "{0:d}") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TextBox3"
ErrorMessage="Inserire la Data di Creazione"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TextBox3"
ErrorMessage="Data di Creazione non valida" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("DataCreazione", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ID_User" HeaderText="User" SortExpression="ID_User" />
<asp:TemplateField HeaderText="Descrizione Viaggio" SortExpression="DescrizioneViaggio">
<EditItemTemplate>
<asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("DescrizioneViaggio") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="TextBox7"
ErrorMessage="Inserire la Descrizione Viaggio"></asp:RequiredFieldValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("DescrizioneViaggio") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="TextBox7"
ErrorMessage="Inserire la Descrizione Viaggio"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label8" runat="server" Text='<%# Bind("DescrizioneViaggio") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Data Partenza" SortExpression="DataPartenza">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("DataPartenza", "{0:d}") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="TextBox2"
ErrorMessage="Inserire la Data di Partenza"></asp:RequiredFieldValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("DataPartenza", "{0:d}") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="TextBox4"
ErrorMessage="Inserire la Data di Partenza"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("DataPartenza", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Durata" SortExpression="Durata">
<EditItemTemplate>
<asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("Durata") %>'></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="TextBox8"
ErrorMessage="Inserire la Durata"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator4" runat="server" ControlToValidate="TextBox8"
ErrorMessage="Durata non valida" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("Durata") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="TextBox8"
ErrorMessage="Inserire la Durata"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator3" runat="server" ControlToValidate="TextBox8"
ErrorMessage="Durata non valida" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label9" runat="server" Text='<%# Bind("Durata") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tour Operator" SortExpression="ID_TourOperator">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource1"
DataTextField="RagioneSociale" DataValueField="ID_TourOperator" SelectedValue='<%# Bind("ID_TourOperator") %>' AppendDataBoundItems="True" ><asp:ListItem Selected="True" Value=""> </asp:ListItem>
</asp:DropDownList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:agenziaConnectionString %>"
SelectCommand="SELECT * FROM [TourOperator]"></asp:SqlDataSource>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/PagineProtette/inserimento/inserimento_TO.aspx">Nuovo Tour Operator</asp:HyperLink>
<asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="DropDownList2"
ErrorMessage="Inserire il Tour Operator"></asp:RequiredFieldValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource1"
DataTextField="RagioneSociale" DataValueField="ID_TourOperator" SelectedValue='<%# Bind("ID_TourOperator") %>' AppendDataBoundItems="True" ><asp:ListItem Selected="True" Value=""> </asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:agenziaConnectionString %>"
SelectCommand="SELECT * FROM [TourOperator]"></asp:SqlDataSource>
<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="DropDownList2"
ErrorMessage="Inserire il Tour Operator"></asp:RequiredFieldValidator>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/PagineProtette/inserimento/inserimento_TO.aspx">Nuovo Tour Operator</asp:HyperLink>
</InsertItemTemplate>
<ItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource1"
DataTextField="RagioneSociale" DataValueField="ID_TourOperator" Enabled="False"
SelectedValue='<%# Bind("ID_TourOperator") %>'>
</asp:DropDownList><br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:agenziaConnectionString %>"
SelectCommand="SELECT * FROM [TourOperator]"></asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Numero Passeggeri Adulti" SortExpression="NumPassAdulti">
<EditItemTemplate>
<asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("NumPassAdulti") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator21" runat="server" ControlToValidate="TextBox9"
ErrorMessage="Inserire il numero passeggeri adulti"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator5" runat="server" ErrorMessage="Numero non valido"
Operator="DataTypeCheck" Type="Integer" ControlToValidate="TextBox9"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("NumPassAdulti") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator22" runat="server" ControlToValidate="TextBox9"
ErrorMessage="Inserire il numero passeggeri adulti"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator6" runat="server" ControlToValidate="TextBox9"
ErrorMessage="Numero non valido" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%# Bind("NumPassAdulti") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Numero Passeggeri Bambini" SortExpression="NumPassBambini">
<EditItemTemplate>
<asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("NumPassBambini") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator23" runat="server" ControlToValidate="TextBox11"
ErrorMessage="Inserire il numero passeggeri bambini"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator7" runat="server" ControlToValidate="TextBox11"
ErrorMessage="Numero non valido" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("NumPassBambini") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator24" runat="server" ControlToValidate="TextBox11"
ErrorMessage="Inserire il numero passeggeri bambini"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator8" runat="server" ControlToValidate="TextBox11"
ErrorMessage="Numero non valido" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label11" runat="server" Text='<%# Bind("NumPassBambini") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Numero Passeggeri Neonati" SortExpression="NumPassNeonati">
<EditItemTemplate>
<asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("NumPassNeonati") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator25" runat="server" ControlToValidate="TextBox12"
ErrorMessage="Inserire il numero passeggeri neonati"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator9" runat="server" ControlToValidate="TextBox12"
ErrorMessage="Numero non valido" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("NumPassNeonati") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator26" runat="server" ControlToValidate="TextBox12"
ErrorMessage="Inserire il numero passeggeri neonati"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator10" runat="server" ControlToValidate="TextBox12"
ErrorMessage="Numero non valido" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label12" runat="server" Text='<%# Bind("NumPassNeonati") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" />
<asp:TemplateField>
<EditItemTemplate>
<hr style="background-color: saddlebrown; height: 7px;" />
</EditItemTemplate>
<InsertItemTemplate>
<hr style="background-color: saddlebrown; height: 7px;" />
</InsertItemTemplate>
<HeaderTemplate>
<hr style="height: 7px; background-color: saddlebrown" />
</HeaderTemplate>
<AlternatingItemTemplate>
<hr style="height: 7px; background-color: saddlebrown" />
</AlternatingItemTemplate>
<ItemTemplate>
<hr style="background-color: saddlebrown; height: 7px;" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Totale Pratica" SortExpression="TotalePratica">
<EditItemTemplate>
¤
<asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("TotalePratica", "{0:C}") %>' ></asp:TextBox><asp:RequiredFieldValidator
ID="RequiredFieldValidator13" runat="server" ControlToValidate="TextBox6" ErrorMessage="Inserire il Totale"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator12" runat="server" ControlToValidate="TextBox6"
ErrorMessage="Totale non valido" Operator="DataTypeCheck" Type="Currency"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
¤
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("TotalePratica") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ControlToValidate="TextBox2"
ErrorMessage="Inserire il Totale"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator11" runat="server" ControlToValidate="TextBox2"
ErrorMessage="Totale non valido" Operator="DataTypeCheck" Type="Currency"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Bind("TotalePratica", "{0:c}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Inserimento pagamenti cliente" InsertVisible="False">
<ItemTemplate>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# Eval("ID_Pratica", "inserimento_pagamenti_cliente.aspx?ID_Pratica={0}") %>'
Text="Inserimento pagamenti cliente"></asp:HyperLink>
</ItemTemplate>
<EditItemTemplate>
<asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl='<%# Eval("ID_Pratica", "inserimento_pagamenti_cliente.aspx?ID_Pratica={0}") %>'
Text="Inserimento pagamenti cliente"></asp:HyperLink>
</EditItemTemplate>
<InsertItemTemplate>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Sconto" SortExpression="Sconto">
<EditItemTemplate>
¤
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Sconto") %>'></asp:TextBox>
<asp:CompareValidator ID="CompareValidator14" runat="server" ControlToValidate="TextBox5"
ErrorMessage="Sconto non valido" Operator="DataTypeCheck" Type="Currency"></asp:CompareValidator>
<asp:CompareValidator ID="CompareValidator22" runat="server" ControlToCompare="TextBox2"
ControlToValidate="TextBox5" ErrorMessage="CompareValidator" Operator="LessThanEqual"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
¤
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Sconto") %>'></asp:TextBox>
<asp:CompareValidator ID="CompareValidator13" runat="server" ControlToValidate="TextBox1"
ErrorMessage="Sconto non valido" Operator="DataTypeCheck" Type="Currency"></asp:CompareValidator>
<asp:CompareValidator ID="CompareValidator21" runat="server" ControlToCompare="TextBox2"
ControlToValidate="TextBox1" ErrorMessage="CompareValidator" Operator="LessThanEqual"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("Sconto", "{0:c}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Provviggione Agenzia" SortExpression="ProvviggioneAgenzia" >
<EditItemTemplate>
¤
<asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("ProvviggioneAgenzia") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" ControlToValidate="TextBox10"
ErrorMessage="Inserire la Provviggione"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator16" runat="server" ControlToValidate="TextBox10"
ErrorMessage="Provviggione non valida" Operator="DataTypeCheck" Type="Currency"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
¤
<asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("ProvviggioneAgenzia") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator16" runat="server" ControlToValidate="TextBox10"
ErrorMessage="Inserire la Provviggione"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator15" runat="server" ControlToValidate="TextBox10"
ErrorMessage="Provviggione non valida" Operator="DataTypeCheck" Type="Currency"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("ProvviggioneAgenzia", "{0:c}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField >
<asp:TemplateField HeaderText="Inserimento pagamenti Tour Operator" InsertVisible="False">
<EditItemTemplate>
<asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl='<%# Eval("ID_Pratica", "inserimento_pagamenti_TO.aspx?ID_Pratica={0}") %>'
Text="Inserimento pagamenti TO"></asp:HyperLink>
</EditItemTemplate>
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID_Pratica", "inserimento_pagamenti_TO.aspx?ID_Pratica={0}") %>'
Text="Inserimento pagamenti TO"></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Scadenza Pagamento Tour Operator" SortExpression="ScadenzaPagamentoTO">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ScadenzaPagamentoTO", "{0:d}") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator17" runat="server" ControlToValidate="TextBox3"
ErrorMessage="Inserire la Scadenza Pagamento"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator17" runat="server" ControlToValidate="TextBox3"
ErrorMessage="Scadenza non valida" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("ScadenzaPagamentoTO", "{0:d}") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator18" runat="server" ControlToValidate="TextBox5"
ErrorMessage="Inserire la Scadenza Pagamento"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator18" runat="server" ControlToValidate="TextBox5"
ErrorMessage="Scadenza non valida" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("ScadenzaPagamentoTO", "{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Numero Estratto Conto Tour Operator" SortExpression="NumEstrattoContoTO">
<EditItemTemplate>
<asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("NumEstrattoContoTO") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator19" runat="server" ControlToValidate="TextBox13"
ErrorMessage="Inserire il Numero Estratto Conto TO"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator19" runat="server" ControlToValidate="TextBox13"
ErrorMessage="Numero Estratto Conto TO non valido" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("NumEstrattoContoTO") %>'></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator20" runat="server" ControlToValidate="TextBox13"
ErrorMessage="Inserire il Numero Estratto Conto TO"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator20" runat="server" ControlToValidate="TextBox13"
ErrorMessage="Numero Estratto Conto TO non valido" Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label13" runat="server" Text='<%# Bind("NumEstrattoContoTO") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Rimanenza" InsertVisible="False" SortExpression="ID_Pratica">
<ItemTemplate>
<asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="SqlDataSource3"
DataTextField="Rimanenza" DataValueField="ID_Pratica" Enabled="False" SelectedValue='<%# Bind("ID_Pratica", "{0}") %>'>
</asp:DropDownList><asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:agenziaConnectionString %>"
SelectCommand="SELECT [ID_Pratica], [Rimanenza] FROM [Rimanenza_Pratica]">
</asp:SqlDataSource>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
</Fields>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<EditRowStyle BackColor="Beige" Font-Bold="True" ForeColor="SaddleBrown" BorderColor="Beige" Wrap="True" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#400000" BorderColor="Maroon" ForeColor="White" />
</asp:DetailsView>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Attenzione:"
ShowMessageBox="True" ShowSummary="False" />
</td>
</tr>
<tr>
<td colspan="3" style="text-align: left">
</td>
</tr>
<tr>
<td style="width: 8px">
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:agenziaConnectionString %>"
SelectCommand="SELECT * FROM [Pratiche]">
</asp:SqlDataSource>
</td>
<td style="width: 3px">
</td>
<td style="width: 19px">
</td>
</tr>
<tr>
<td style="width: 8px">
<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/PagineProtette/inserimento/inserimento.aspx" Font-Names="Arial" Font-Size="Small" Width="237px">Menù inserimento</asp:HyperLink></td>
<td style="width: 3px">
</td>
<td style="width: 19px">
</td>
</tr>
<tr>
<td style="width: 8px">
</td>
<td style="width: 3px">
</td>
<td style="width: 19px">
</td>
</tr>
</table>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
Sei connesso<br />
<asp:LoginName ID="LoginName1" runat="server" />
<br />
<br />
<br />
<asp:LoginStatus ID="LoginStatus1" runat="server" Font-Names="Arial" Font-Size="Small"
LogoutAction="RedirectToLoginPage" LogoutPageUrl="~/Login.aspx" LogoutText="Chiudi sessione" />
</LoggedInTemplate>
</asp:LoginView>
<br />
<br />
<br />
<br />
</div>
</form>
</body>
</html>
Mi dà problemi strani: ti faccio un esempio. Se come totale metto ad esempio 1.234 euro, e come sconto metto 100 euro, non ho problemi. Se come sconto metto 200 o 300 euro, mi appare il comparevalidator. Sicuramente sto sbagliando da qualche parte, ma non capisco dove.
Grazie infinite per l'aiuto!!!
ciao Patrizia