dimanche 7 mai 2017

Allow postback using if statement?

Is it possible to only allow postback from a button click when an if statement is true? Whenever the postback occurs from the else part of the statement it resets the lblPrice to 100

lblPrice.Text ="100"
int biggerPrice =500;       

    if (txb1.Text != "0" )
    {
     lblPrice.Text = biggerPrice.ToString();
    else{
     lblErr.Text = "Woops!";
    }

Aucun commentaire:

Enregistrer un commentaire