Link to home
Start Free TrialLog in
Avatar of Camillia
CamilliaFlag for United States of America

asked on

Setting a decimal textbox field to blank

I have a decimal textbox field that when first displayed is just blank. User enters 499.40 whatever. Clicks "clear fields" and I want to reset this field back to blank, not to zero...

I have below code but not sure how to do it. I want it to equal to 'string.Empty" BUT NOT to zero...
//property
private decimal? StartSalary
    {
        get
        {


            decimal? salaryValue = null;
            if (!string.IsNullOrEmpty(txtJobStartSalary.Text))
                salaryValue = Decimal.Parse(txtJobStartSalary.Text);
            return salaryValue;

        }

        set { txtJobStartSalary.Text = Convert.ToString(value); }
    }

// in clear submit button
StartSalary = 0; //BUT i want it to be blank not zero

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of NazoUK
NazoUK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial