i have a simple button that when clicked it just updates a label but everytime i click it once nothing happens but if i click it a second time then it does a postback and will change to label. Why does it take two clicks? This is happening with a few buttons but not all of them.
protected void IOD_InterestRate_Update_Button_Click(object sender, EventArgs e)
{
string InterestRate = "";
if (IOD_InterestRate.Text.EndsWith("%"))
{
InterestRate = IOD_InterestRate.Text.TrimEnd('%');
IOD_Label2.Text = InterestRate;
}
else
{
IOD_Label2.Text = IOD_InterestRate.Text;
IOD_InterestRate.Text = IOD_InterestRate.Text + "%";
}
}
protected void IOD_InterestRate_Update_Button_Click(object sender, EventArgs e)
{
string InterestRate = "";
if (IOD_InterestRate.Text.EndsWith("%"))
{
InterestRate = IOD_InterestRate.Text.TrimEnd('%');
IOD_Label2.Text = InterestRate;
}
else
{
IOD_Label2.Text = IOD_InterestRate.Text;
IOD_InterestRate.Text = IOD_InterestRate.Text + "%";
}
}