43 messaggi dal 06 agosto 2010
Ciao ragazzi , mi succedeun cosa stranissima.

Ho un CreateUserWizard ne quale ho aggiunto dei campi custom per inserire informazioni di profile.

Imposto il validatiogroup nei validatori dei singoi controlli relativi alle proprità del profile, ma nulla.

Faccio salva, e l'evento viene scatenato anche se ad esempio la proprietà Nome non è stata alimentata.

Ora, io specifico lo stesso validationGroup per tutti i controlli, che è lo stesso che uso ad esempio per lo UserName.

Devo specificare il validationGroup im maniera esplicita in qualhe proprietà del CreateUserWizard?

La cosa strana è che fino a qualche giorno fa tutto funzionava.

Vi allego il lungo markup del mio CreateUserWizard:

<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
<ContentTemplate>
<table>
<tr>
<td align="left">
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
</td>
<td align="left">
<asp:TextBox ID="UserName" runat="server" Width="150px" Enabled="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" Display="Dynamic"
ControlToValidate="UserName" ErrorMessage="Inserire Username" ToolTip="Username obbligatorio"
ValidationGroup="cuwUserUPD" ForeColor="Red" />
</td>
<td align="left">
<asp:Label ID="lblLuogoDiNascita" runat="server" Text="Luogo di nascita" />
</td>
<td align="left">
<asp:TextBox ID="txtLuogoDiNascita" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtLuogoDiNascita"
ErrorMessage="Immettere il luogo di nascita" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email" Enabled="false">Email aziendale</asp:Label>
</td>
<td align="left">
<asp:TextBox ID="Email" runat="server" Width="150px" MaxLength="100" ></asp:TextBox>
<asp:RegularExpressionValidator ID="revEmail" ControlToValidate="Email" runat="server"
ValidationGroup="cuwUserUPD" ErrorMessage="Formato email non valido" ValidationExpression="^[\w\-\.]*[\w\.]\@[\w\.]*[\w\-\.]+[\w\-]+[\w]\.+[\w]+[\w $]"
Display="Dynamic" ForeColor="Red"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
ErrorMessage="Immettere E-mail aziendale" Display="Dynamic" ToolTip="E-mail aziendale obbligatoria"
ValidationGroup="cuwUserUPD" ForeColor="Red" />
</td>
<td align="left">
<asp:Label ID="lblResidenza" runat="server" Text="Residenza" />
</td>
<td align="left">
<asp:TextBox ID="txtResidenza" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvResidenza" runat="server" ControlToValidate="txtResidenza"
ErrorMessage="Immettere la residenza" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblNome" runat="server" Text="Nome" />
</td>
<td align="left">
<asp:TextBox ID="txtNome" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvNome" runat="server" ControlToValidate="txtNome"
ErrorMessage="Immettere nome" Display="Dynamic" ToolTip="Nome obbligatorio" ValidationGroup="cuwUserUPD"
ForeColor="Red" />
</td>
<td align="left">
<asp:Label ID="lblDomicilio" runat="server" Text="Domicilio" />
</td>
<td align="left">
<asp:TextBox ID="txtDomicilio" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvDomicilio" runat="server" ControlToValidate="txtDomicilio"
ErrorMessage="Immettere il domicilio" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblCognome" runat="server" Text="Cognome" />
</td>
<td align="left">
<asp:TextBox ID="txtCognome" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvCognome" runat="server" ControlToValidate="txtCognome"
ErrorMessage="Immettere cognome" Display="Dynamic" ToolTip="cognome obbligatorio"
ValidationGroup="cuwUserUPD" ForeColor="Red" />
</td>
<td align="left">
<asp:Label ID="lblPIVA" runat="server" Text="P. IVA" />
</td>
<td align="left">
<asp:TextBox ID="txtPIVA" runat="server" Width="150px" MaxLength="11"></asp:TextBox>
<asp:Label ID="lblNotificaIVA" runat="server" ForeColor="Red" Visible="false" Text="Partita IVA esistente"></asp:Label>
<asp:RequiredFieldValidator ID="rfvPIVA" runat="server" ControlToValidate="txtPIVA"
ErrorMessage="Immettere la partita iva" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblCodiceFiscale" runat="server" Text="Codice fiscale" />
</td>
<td align="left">
<asp:TextBox ID="txtCodiceFiscale" runat="server" Width="150px" MaxLength="16"></asp:TextBox>
<asp:Label ID="lblNotificaCodiceFiscale" runat="server" ForeColor="Red" Visible="false"
Text="Codice fiscale esistente"></asp:Label>
<asp:RequiredFieldValidator ID="rfvCodiceFiscale" runat="server" ControlToValidate="txtCodiceFiscale"
ErrorMessage="Immettere codice fiscale" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
<td align="left">
<asp:Label ID="lblIBAN" runat="server" Text="IBAN" />
</td>
<td align="left">
<asp:TextBox ID="txtIBAN" runat="server" Width="150px" MaxLength="30"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvIBAN" runat="server" ControlToValidate="txtIBAN"
ErrorMessage="Immettere l'IBAN" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblEmailPrivata" runat="server" Text="E-mail privata" />
</td>
<td align="left">
<asp:TextBox ID="txtEmailPrivata" runat="server" Width="150px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="txtEmailPrivata"
runat="server" ValidationGroup="cuwUserUPD" ErrorMessage="Formato email non valido"
ValidationExpression="^[\w\-\.]*[\w\.]\@[\w\.]*[\w\-\.]+[\w\-]+[\w]\.+[\w]+[\w $]"
Display="Dynamic" ForeColor="Red"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="rfvEmailPrivata" runat="server" ControlToValidate="txtEmailPrivata"
ErrorMessage="Immettere email privata" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
<td align="left">
<asp:Label ID="lblStatoUtente" runat="server" Text="Stato utente" />
</td>
<td align="left">
<asp:DropDownList ID="ddl_StatoUtente" DataTextField="statoUtente_nome" DataValueField="statoUtente_ID"
runat="server" Width="150px">
</asp:DropDownList>
<asp:CompareValidator ID="cmpStatoUtente" runat="server" ControlToValidate="ddl_StatoUtente"
ErrorMessage="Selezionare lo stato utente" Display="Dynamic" ForeColor="Red"
ValueToCompare="2" Operator="LessThan" ValidationGroup="cuwUserUPD"></asp:CompareValidator>
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblMatricola" runat="server" Text="Matricola" />
</td>
<td align="left">
<asp:TextBox ID="txtMatricola" runat="server" Width="150px" MaxLength="10"></asp:TextBox>
<asp:Label ID="lblNotificaMatricola" runat="server" ForeColor="Red" Visible="false"
Text="Matricola esistente"></asp:Label>
<asp:RequiredFieldValidator ID="rfvMatricola" runat="server" ControlToValidate="txtMatricola"
ErrorMessage="Immettere matricola" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
<td align="left">
<asp:Label ID="lblTelefono1" runat="server" Text="Telefono 1" />
</td>
<td align="left">
<asp:TextBox ID="txtTelefono1" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvTElefono1" runat="server" ControlToValidate="txtTelefono1"
ErrorMessage="Immettere numero telefonico" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblSesso" runat="server" Text="Sesso" />
</td>
<td align="left">
<asp:DropDownList ID="ddl_Sesso" DataTextField="sessoUtente_nome" DataValueField="sessoUtente_id"
runat="server" Width="150px">
</asp:DropDownList>
<asp:CompareValidator ID="cmpSessoUtente" runat="server" ControlToValidate="ddl_Sesso"
ErrorMessage="Selezionare il sesso" Display="Dynamic" ForeColor="Red" ValueToCompare="0"
Operator="GreaterThan" ValidationGroup="cuwUserUPD"></asp:CompareValidator>
</td>
<td align="left">
<asp:Label ID="lblTelefono2" runat="server" Text="Telefono 2" />
</td>
<td align="left">
<asp:TextBox ID="txtTelefono2" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvTelefono2" runat="server" ControlToValidate="txtTelefono2"
ErrorMessage="Immettere numero telefonico" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblTitoloDiStudio" runat="server" Text="Titolo di studio" />
</td>
<td align="left">
<asp:TextBox ID="txtTitoloDiStudio" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvTitoloDiStudio" runat="server" ControlToValidate="txtTitoloDiStudio"
ErrorMessage="Immettere un titolo di studio" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
<td align="left">
<asp:Label ID="lblNomeBanca" runat="server" Text="Banca" />
</td>
<td align="left">
<asp:TextBox ID="txtNomeBanca" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvNomeBanca" runat="server" ControlToValidate="txtNomeBanca"
ErrorMessage="Immettere la banca" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblDataDiNascita" runat="server" Text="Data di nascita" />
</td>
<td align="left">
<asp:TextBox ID="txtDataDiNascita" runat="server" Width="150px" onfocus="Change(this, event)"
onblur="Change(this, event)"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvDataDiNascita" runat="server" ControlToValidate="txtDataDiNascita"
ErrorMessage="Immettere la data di nascita" Display="Dynamic" ToolTip="" ValidationGroup="cuwUserUPD"
ForeColor="Red" Enabled="false" />
<asp:CompareValidator ID="cmpDataDiNascita" ControlToValidate="txtDataDiNascita"
ErrorMessage="Formato data errato" SetFocusOnError="true" Display="Dynamic" Type="Date"
Operator="DataTypeCheck" runat="server" ForeColor="Red" ValidationGroup="cuwUserUPD"
Enabled="true"></asp:CompareValidator>
<asp:CalendarExtender ID="CalendarExtenderDataDiNascita" runat="server" Format="dd/MM/yyyy"
TargetControlID="txtDataDiNascita">
</asp:CalendarExtender>
</td>
<td align="left">
<asp:Label ID="lblIntestatarioConto" runat="server" Text="Intestatario conto" />
</td>
<td align="left">
<asp:TextBox ID="txtIntestatarioConto" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv" runat="server" ControlToValidate="txtIntestatarioConto"
ErrorMessage="Immettere l'intestatario del conto" Display="Dynamic" ToolTip=""
ValidationGroup="cuwUserUPD" ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="lblRuoliDisponibili" runat="server" Text="Ruoli disponibili"></asp:Label>
</td>
<td align="left" colspan="3">
<asp:ListBox ID="lstRuoliDisponibili" runat="server" SelectionMode="Multiple" Width="150px" Height="100px" />
<asp:Label ID="lblNotificaRuoli" runat="server" ForeColor="Red" Visible="false"
Text="Selezionare almeno un ruolo"></asp:Label>
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question" Visible="false">Security Question:</asp:Label>
</td>
<td align="left">
<asp:TextBox ID="Question" runat="server" Visible="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
ErrorMessage="Security question is required." Display="Dynamic" ToolTip="Security question is required."
ValidationGroup="cuwUserUPD" ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="left">
<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer" Visible="false">Security Answer:</asp:Label>
</td>
<td align="left">
<asp:TextBox ID="Answer" runat="server" Visible="false"></asp:TextBox>
<asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
ErrorMessage="Security answer is required." Display="Dynamic" ToolTip="Security answer is required."
ValidationGroup="cuwUserUPD" ForeColor="Red" Enabled="false" />
</td>
</tr>
<tr>
<td align="center" colspan="4" style="color: Red;">
<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
</table>
</ContentTemplate>
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
<ContentTemplate>
<table>
<tr>
<td colspan="4">
<asp:Label ID="lblNotificaInserimentoUtente" runat="server" Text="Utente inserito"
ForeColor="Green" Font-Size="Medium"></asp:Label>
</td>
</tr>
<tr>
<td align="center" colspan="4">
<asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continua"
Text="Continua" ValidationGroup="cuwUserUPD" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
aripan72 wrote:
Devo specificare il validationGroup im maniera esplicita in qualhe proprietà del CreateUserWizard?
La cosa strana è che fino a qualche giorno fa tutto funzionava.

no, devi impostare CausesValidation su true, anzichè su false, come hai fatto sul button Continue.
.

Daniele Bochicchio | ASPItalia.com | Libri
Chief Operating Officer@iCubed
Microsoft Regional Director & MVP

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.