Posted on 2014-07-13
Last Modified: 2014-07-21
Hi Team,

How to open new window or new tab using response.redirect with out any client side code?
Question by:mannevenu26
    LVL 74

    Expert Comment

    by:käµfm³d 👽
    The only way to open a new window is either with Javascript or with the target attribute.
    LVL 17

    Accepted Solution

    you have to set form target for links in the page to a new blank window. if you want it only for few links and not all links in the page then you need to do a validation before the page submit at server side.

    the code below is from

    You need to add the following to your server side link/button:
    OnClientClick=" ='_blank';"
    My entire button code looks something like:
    <asp:LinkButton ID="myButton" runat="server" Text="Click Me!" 
                    OnClientClick=" ='_blank';"/>

    Open in new window

    In the server side OnClick I do a Response.Redirect("MyPage.aspx"); and the page is opened in a new window.

    The other part you need to add is to fix the form's target otherwise every link will open in a new window. To do so add the following in the header of your POPUP window.
    <script type="text/javascript">
        function fixform() {
            if (opener.document.getElementById("aspnetForm").target != "_blank") return;
            opener.document.getElementById("aspnetForm").target = "";
            opener.document.getElementById("aspnetForm").action = opener.location.href;

    Open in new window

    <body onload="fixform()">

    Open in new window

    LVL 52

    Expert Comment

    by:Scott Fell, EE MVE
    No points.

    I just answered the same question on the classic asp side.  This is one of those things where the answer is you can't do that.  In pure html, use target="_blank"    kaufmed has the answer http:#a40193779.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now