Camillia
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...
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.