I am building a program in C#. What I want to do is, "When I press search, if textbox one and textbox 2 contain only numbers, show search results".
How do I say, "if contains 0-9"?
My current method does not work. I tried Contains, but I want it to include all the numbers.
protected void Button1_Click(object sender, EventArgs e)
{
    if (TextBox1.Text != "0-9" && TextBox2.Text != "0-9")  
    {
        GridView1.Visible = true;
    }
    else  
    {
        Label3.Text = "Insert phone and id correctly:" ;
    }
}
 
     
    