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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:54:58+00:00 2026-06-13T11:54:58+00:00

I have got some code at the end of a button click event that

  • 0

I have got some code at the end of a button click event that uses RegisterStartupScript to open up a new Windows (its to a report for the user to print of)

After the page has loaded i would then like to re-direct the user away from the data entry page back onto the default page, but if i put a Response.Redirect in it does not open up my popup window. Any idea why the popup would not fire?

This is the c# code:

string myRptURL = "EstimateReport.aspx?id=" + hiddenID.Value;
                string script = "window.open('" + myRptURL + "','')";

                ClientScript.RegisterStartupScript(this.GetType(), "OpenWin", "<script>openNewWin('" + myRptURL + "')</script>");
                Response.Redirect("default.aspx?mess=" + Server.UrlEncode("New Estimate Created"));

and this is the Javascript function:

<script language="javascript" type="text/javascript">

function openNewWin(url) {
    var x = window.open(url, 'mynewwin', '_blank', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=520,modal=yes,alwaysRaised=yes');
    x.focus();
}

  • 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-13T11:54:59+00:00Added an answer on June 13, 2026 at 11:54 am

    The Response.Redirect is canceling the script since it is not being sent to the client. redirect in javascript instead.

    ClientScript.RegisterStartupScript(this.GetType(), "OpenWin",
     "<script>openNewWin('" + myRptURL + "','" + "default.aspx?mess=" +
     Server.UrlEncode("New Estimate Created") + "')</script>");
    
    function openNewWin(url, redirectUrl) {
        var x = window.open(url, 'mynewwin', '_blank', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=520,modal=yes,alwaysRaised=yes');
        x.focus();
        window.location = redirectUrl;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a piece of code, that should countdown some number (in this
I have got a code snippet as follows: Dim fstream = new filestream(some file
Ok, so I've got some legacy code from another company that I have to
I have got an ASP page that does some back-end processing. It calls a
I've got some code that uses the regular Forms API to put together a
I have got some javascript code and I'd like to convert this to C#.
I've got some Columns in a DataGridView that have their Binding property set to
I have a bit of code that concatenates text from some input boxes and
I've got some code originating from a DSL that needs to be translated for
I've got some code that needs to scan through a hierarchical database schema, looking

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.