I am trying to limit the input of a textbox of a very simple Web Application so that the user can only input numbers. Im having trouble doing this without using 20 lines of code, any help at all is appreciated!
protected void Button1_Click(object sender, EventArgs e)
{
{
int input = int.Parse(InputBox.Text);
if (input > 15)
{
String hot;
hot = "hot";
Result.Text = hot;
Result.BackColor = System.Drawing.Color.Red;
}
else if (input <= 15)
{
String cold;
cold = "cold";
Result.Text = cold;
Result.BackColor = System.Drawing.Color.Blue;
}
}
}
Thank you!