Ho provato a fare
codice:aspx <INPUT class="input" id="txt_immagine" type="file" size="85" name="img" runat="server"> <asp:Label id="lbl_nomeimg" runat="server" CssClass="TestoEvidenziato"></asp:Label> <asp:CustomValidator id="Ctrl_immagine" runat="server" ControlToValidate="txt_immagine" ErrorMessage='Il campo "Immagine" è obbligatorio.'></asp:CustomValidator> <asp:ValidationSummary ID="ValFrm" Runat="server" ShowMessageBox="True" ShowSummary="False"></asp:ValidationSummary>ma non funziona....codice:vb Sub btn_conferma_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_conferma.Click If Me.txt_immagine.Value = "" And Me.lbl_nomeimg.Text = "" Then ... ... ... Else Me.Ctrl_immagine.IsValid = False End If

Rispondi quotando