ok il codice è questo:
Lato SERVER:
public partial class userControl_frmCandidatura : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnInvia_Click(object sender, EventArgs e)
{
if (checkInput())
Response.Write("Ok");
}
protected bool checkInput()
{
bool ret = true;
string StrTestoKO = "Campo obbligatorio";
string StrTestoOK = "";
if ((txtNomeCandidato.Text == "")||(txtNomeCandidato.Text == " ") )
{
fieldValidatorNome.Text = StrTestoKO;
ret = ret && false;
}
else
{
fieldValidatorNome.Text=StrTestoOK ;
ret = ret && true;
}
if ((txtCognomeCandidato.Text == "") || (txtCognomeCandidato.Text == " "))
{
fieldValidatorCognome.Text = StrTestoKO;
ret = ret && false;
}
else
{
fieldValidatorCognome.Text=StrTestoOK ;
ret = ret && true;
}
if ((txtMailCandidato.Text == "") || (txtMailCandidato.Text == " ")
&& (!txtMailCandidato.Text.Contains("@")))
{
fieldValidatorMail.Text = StrTestoKO;
ret = ret && false;
}
else
{
fieldValidatorMail.Text=StrTestoOK;
ret = ret && true;
}
if (!flUpldCv.HasFile)
{
fieldValidatorCv.Text = StrTestoKO;
ret = ret && false;
}
else
{
fieldValidatorCv.Text=StrTestoOK ;
ret = ret && true;
}
if (!flUpldFoto.HasFile)
{
fieldValidatorFoto.Text = StrTestoKO;
ret = ret && false;
}
else
{
fieldValidatorFoto.Text=StrTestoOK;
ret = ret && true;
}
return ret;
}
protected void chkAccPrivacy_CheckedChanged1(object sender, EventArgs e)
{
btnInvia.Enabled = chkAccPrivacy.Checked;
chkAccPrivacy.Enabled = !btnInvia.Enabled;
}
}
lato CLIENT:
meglio i perdenti xkè hanno la speranza di vincere...cosa che i vincenti nn hanno....