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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:37:17+00:00 2026-06-15T19:37:17+00:00

Clicking on ASP.NET button redirects to correct website but on the same tab, not

  • 0

Clicking on ASP.NET button redirects to correct website but on the same tab, not in a new tab what i need to do. What’s wrong with the code OnClientClick="aspnetForm.target ='_blank';" below? Why it is not enough alone and what else need to be done?

The following ASP.NET code for the button control is:

<asp:Button ID="btnGenerateReport" runat="server" Text="Generate Report" 
OnClick="btnGenerate_Click" OnClientClick="aspnetForm.target ='_blank';" />
  • 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-15T19:37:19+00:00Added an answer on June 15, 2026 at 7:37 pm

    If you are looking out for server side code to open a new window on Button Click, then here’s how to do so.

    Add the following script to the section of your page

    <script language="javascript" type="text/javascript">
        function openNewWin(url) {
            var x = window.open(url, 'mynewwin', 'width=600,height=600,toolbar=1');
            x.focus();
        }
    </script>
    

    Then add a Button Control in the following manner

    <asp:Button ID="btnOpenPop" runat="server" Text="Open Pop"           
        onclick="btnOpenPop_Click" />
    

    Finally add some code in the code behind file

    protected void btnOpenPop_Click(object sender, EventArgs e)
    {
        string url = "http://www.dotnetcurry.com";
        ClientScript.RegisterStartupScript(this.GetType(), "OpenWin", "<script>openNewWin('" + url + "')</script>");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have website that is ASP.NET with Forms Authentication, clicking the logout button does
i need to implement a back button for my asp.net website.I am able to
I work on Asp.Net VS08 C#. Clicking on Button want to show popup. popup
after clicking on button in asp.net application process.start() runs edmgen tool with arguments. And
I have an ASP.NET web page having a button in it. Clicking the button,
I have a button in my asp.net web application. When i clicking the button
I am using a modal window in my asp.net application. On clicking a button
My ASP.NET MVC 3 website has code on the server side that checks for
I have a asp.net button control. My requirement is such that upon clicking the
My situation : I have a problem with an ASP.NET button, which does not

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.