Q:

How do I handle False/Empty query's in a ASP.net Web forms App?

I am building a web forms app in Visual Studio and have a number of button functions to allow the user to add, alter and delete from my database.
And all the functions work the way they are intended up until a user enters the wrong information or doesn't enter anything
Here is the error I get 

I have done some research myself but I am still not sure how to fix it, And would love some help
Here is the code in question 
   public partial class DeleteCharacters : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        private MarvelModelContext context = new MarvelModelContext();

        protected void btnDeleteId_Click(object sender, EventArgs e)
        {
            int id = System.Convert.ToInt32(txtId.Text);
            string Sname = SNameT.Text;
            Character CRead = context.Character.FirstOrDefault(c => c.CharacterId == id && c.Superhero == Sname);
            context.Character.Remove(CRead);//Error Pops up here 

            context.SaveChanges();

            //Clear Feilds
            txtId.Text = "";
            SNameT.Text = "";
        }

    }

A:

As @MKS suggested you must check for null if you are using FirstOrDefault. This returns null if it can't find a match in your lambda expression. So, the updated method should look like this.
 public partial class DeleteCharacters : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    private MarvelModelContext context = new MarvelModelContext();

    protected void btnDeleteId_Click(object sender, EventArgs e)
    {
        int id = System.Convert.ToInt32(txtId.Text);
        string Sname = SNameT.Text;
        Character CRead = context.Character.FirstOrDefault(c => c.CharacterId == id && c.Superhero == Sname);

        if(CRead != null) // added this condition
        {
            context.Character.Remove(CRead);

            context.SaveChanges();

            //Clear Feilds
            txtId.Text = "";
            SNameT.Text = "";
        }
    }
}

