Close button to Facebox Jquery box closes master page, not popup
<p>I am using the Facebox jquery box to load a little form with a Submit Button and a Cancel Button.</p>

<p>When I click Submit it closes the Main page that loaded the Facebox window instead of the Facebox window!  It leaves the AddNote.aspx site open (which is loaded by Facebox) and closes my Main.aspx. </p>

<p>Here is my code behind in AddNote.aspx  (Which is rendered by the Facebox popup on Main.aspx):</p>

<pre><code>    protected void SubmitButtom_Click(object sender, EventArgs e)
    {

        string note = NotesTextBox.Text;

        //will need to add current user

        using (cmd = new SqlCommand("INSERT INTO notes (FID, note_date, note_text) VALUES (@FID, @note_date, @note_text)", con))
        {
            con.Open();
            cmd.Parameters.Add(new SqlParameter("FID", FID));
            cmd.Parameters.Add(new SqlParameter("note_date", DateTime.Now.ToString()));
            cmd.Parameters.Add(new SqlParameter("note_text", note));
            cmd.ExecuteNonQuery();
            con.Close();
            Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closeModal", "$.facebox.close();");              //WHY DOES THIS CLOSE MAIN.ASPX INSTEAD OF FACEBOX WINDOW?                  
        }           

    }
</code></pre>
