Below if else condition is not working
I am giving input in TextBox, if TextBox is equal to 1 then then display in label 2 else 3, but it is not displaying in Label.
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
protected void Button1_Click(object sender, EventArgs e)
{
int f1 = !string.IsNullOrEmpty(Label1.Text) ? Convert.ToInt32(Label1.Text) : 0;
if (TextBox1.Text=="1")
{
f1 = 2;
}
else
{
f1 = 3;
}
}