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 8225727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:30:44+00:00 2026-06-07T15:30:44+00:00

i m opening an Webpage(Clock.aspx) from window.showModalDialog of javascript.In the Clock.aspx i have a

  • 0

i m opening an Webpage(Clock.aspx) from window.showModalDialog of javascript.In the Clock.aspx i have a button and i want that when the user click on that button the Clock.aspx page will be closed. I dont want to use onClientClick() method of javascript as some server side database insertion is going on and after the insertion i want to close this page.

The Code behind of the button is as follows:-

protected void btnStop_Click(object sender, EventArgs e)
    {
        _nonProduction = new NonProduction();
        if (Session["LastNonProdTimeID"] == null)
        {
        }
        else
        {
            int NonProdTimeEntryID = Convert.ToInt32(Session["LastNonProdTimeID"]);
            //Updating the TimeSpent
            isTimeSpentUpdated = _nonProduction.UpdateTimeSpentInDB(NonProdTimeEntryID);
            if (isTimeSpentUpdated == true)
            {

                string timespent = Convert.ToString(_nonProduction.GetTimeSpent(NonProdTimeEntryID));
                string msg = "Total time consumed  in " +HiddenTaskname.Value.ToString()+": " + timespent.ToString() + " Minutes";
                ClientScript.RegisterStartupScript(typeof(Page), "closePage", "<script type='text/JavaScript'>window.close();</script>");

                //ShowPopUpMsg(msg);
            }
            else
            {
            }
        }



    }

Here when i m clicking on the Button one more (Clock.aspx)pop up is appearing and window is not closing. Please help me that how i close the ShowModalDialog from server side code. I m using Script manager in my page also.
Thanks in Advance.

  • 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-07T15:30:45+00:00Added an answer on June 7, 2026 at 3:30 pm

    I had added <base target="_self">to the head section of the clock.aspx page and then it works fine for me.

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

Sidebar

Related Questions

When opening a new tkinter window, I only want the user to be able
What is the code for Opening a web page in new Window? My click
I have an iframe on a web page that is on the opening page
I am opening a Child Modal Dialog window from my parent web page. The
When a user visits your flash-rich webpage from Internet Explorer, and he/she doesn't have
I have a link on my web page. When I click it I open
I have created webpage and I am calling it from Jquery function. Technically I
I have a modal dialog which opens on click of Edit button of my
I have an HTML web page (the parent) that contains a hyperlink. When clicked,
I have a current webpage that is broken into two sections. The top section

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.