Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8688557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:23:55+00:00 2026-06-12T23:23:55+00:00

I am using the Facebox jquery box to load a little form with a

  • 0

I am using the Facebox jquery box to load a little form with a Submit Button and a Cancel Button.

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.

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

    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?                  
        }           

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:23:56+00:00Added an answer on June 12, 2026 at 11:23 pm

    Welcome to ASP.NET

    You’re using server-side code to process this form. That means you have to do what ASP.NET terms a “PostBack”. What this means is that the form on the page is submitting data back to itself for processing. Since the “submit” button was the button that triggered it, your handler gets called.

    The important thing here is that this requires a trip to the server. The form is being submitted, which in normal HTTP (and thus in ASP.NET, as it is a framework built for HTTP processing), means a page refresh. The browser says “Oh! The form is being submitted! Time to make a request to the server, and wait for a response. I can probably unload the page I have right now.” So it does.

    In order to do what you want, look into “AJAX”, or Asynchronous XMLHttpRequest. They’re the same thing, except that one is more buzz-wordy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using facebox that give help for opening box from link but i
i want to enable facebox jquery using javascript. here in normal html <a href=stairs.jpg
i am using facebox (a jquery modal plug-in) and tinymce for my textboxes. however
I'm using FaceBox I'd like for it to open 1 time only on page
I have a website that uses ajax jquery and facebox. Demo here : http://temp.nevergone.eu/facebox.php
I have multiple jquery files in my project. I am using facebox using jquery1.4.2
I am using facebox which uses jQuery 1.2.1 on my website here http://www.pointclickshoot.com/beta2 The
I am using the facebox plugin in jQuery. I would like to maintain a
I'm not good with javascript. I'm using a facebox login form based on this
I am using facebox to display a contact form, however when the user selects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.