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

  • SEARCH
  • Home
  • 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 9132953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:24:08+00:00 2026-06-17T08:24:08+00:00

I have a pop out message box, what I want is the message box

  • 0

I have a pop out message box, what I want is the message box always pop out in front of the browser when it is clicked, but the problem is it sometimes pop out behind the browser.
Anything I can do to make sure the message box is always pop out in front the browser?
Thanks.

protected void Button1_Click(object sender, EventArgs e)
{
    string appointmentdate = Convert.ToString(DropDownListDay.Text + "-" + DropDownListMonth.Text + "-" + DropDownListYear.Text);
    string appointmenttime = Convert.ToString(DropDownListTime.Text);


    using (SqlConnection con = new SqlConnection("Data Source=USER-PC;Initial Catalog=webservice_database;Integrated Security=True"))
    {
        con.Open();
        SqlCommand data = new SqlCommand("Select COUNT(*) from customer_registration where adate='" + appointmentdate + "'AND atime='" + appointmenttime + "'", con);
        Int32 count = (Int32)data.ExecuteScalar();
        if (count == 0)
        {
            SqlConnection con1 = new SqlConnection("Data Source=USER-PC;Initial Catalog=webservice_database;Integrated Security=True");
            SqlCommand cmd = new SqlCommand("UPDATE customer_registration SET servicetype = @servicetype, comment = @comment, adate = @adate, atime = @atime where username='" + Session["username"] + "'", con1);
            con1.Open();

            cmd.Parameters.AddWithValue("@servicetype", DropDownListServicetype.Text);
            cmd.Parameters.AddWithValue("@comment", TextBoxComment.Text);
            cmd.Parameters.AddWithValue("@adate", DropDownListDay.Text + "-" + DropDownListMonth.Text + "-" + DropDownListYear.Text);
            cmd.Parameters.AddWithValue("@atime", DropDownListTime.Text);
            cmd.ExecuteNonQuery();

            con1.Close();
            Response.Redirect("MakeAppointmentSuccess.aspx");
        }
        else
        {
            MessageBox.Show("This appointment is not available. Please choose other date & time.");
            con.Close();
        }
    }
}
  • 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-17T08:24:09+00:00Added an answer on June 17, 2026 at 8:24 am

    You’re mixing the Win32 message box with ASP.NET’s Response.Redirect. Since this post is tagged ASP.NET and you’re calling Response.Redirect, I’m assuming this is an ASP.NET application, and not a WinForms or WPF application.

    What is happening is that the message box is popping up on the “server”, while the browser is the “client”, which on your developer machine is the same thing. Never call MessageBox.Show from an ASP.NET application. The reason why is that the message box you are seeing is not coming from the browser, and once you deploy this to a true server, clients will never see the message box and your server may or may not be flooded with message box windows (depending on which user is running and what the privileges are).

    In order to make a “MessageBox”-style alert in the browser, you must use the JavaScript alert() function. You can either do this on the HTML (ASPX) or JS files rendered by the browser, or by calling ScriptManager.RegisterStartupScript. Take a look at the answers to this SO question for details: ScriptManager.RegisterStartupScript code not working – why?

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

Sidebar

Related Questions

I have an application page. I want to click a button to pop out
I have a pop-up window in jQuery that fades in, and will fade out
I have a grid that I want to pop up in a new window.
I have pop-up with h:selectOneMenu . This pop-up will be displayed on a4j:commandLink click.
I've been trying to use 'import poplib' to access gmail, since I have Pop
I have a pop up form that i wish to close on successfull submit
I have a pop-up window a user logs into, once they are logged in
I have a pop up which is timed to appear after 2 minutes on
I have a pop-up, (what should be modal), dialogue for messages to the user
I have a pop up with plenty of options which can be edited -

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.