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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:59:40+00:00 2026-05-22T15:59:40+00:00

Can anybody suggest how we can open the page in new window using Response.Redirect

  • 0

Can anybody suggest how we can open the page in new window using Response.Redirect in c#, I know we can do it using response.write as given below:

Response.Write("<script>");
Response.Write("window.open('"+url+"','_blank')");
Response.Write("</script>");

But what when javascript is disabled, the above code will not run.

Please suggest!!

  • 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-05-22T15:59:40+00:00Added an answer on May 22, 2026 at 3:59 pm

    As Tom Gullen suggested that is the only way.
    I am assuming you’re using ASP.NET.

    You can create a public function which receives the Url you want to open in the new windows.
    This function then redirects to a page which does the dirty job.

    Public Function ResponseRedirect(ByVal urlRedirect As String) As Boolean
        HttpContext.Current.Response.Redirect("Redirector.aspx?goto=" & HttpUtility.UrlEncode(urlRedirect))
    End Function
    

    This is Redirector.aspx

    Public Partial Class Redirector
        Inherits System.Web.UI.Page
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim OpenNewPage As String = ""
            If Request.QueryString("goto") IsNot Nothing Then
                Me.OpenNewPage = Request.QueryString("goto")
            End If
            If Request.UrlReferrer.AbsoluteUri IsNot Nothing Then
                Me.Referer = Request.UrlReferrer.AbsoluteUri
            End If
        End Sub
    
        Private _OpenNewPage As String = ""
        Public Property OpenNewPage() As String
            Get
                Return _OpenNewPage
            End Get
            Set(ByVal value As String)
                _OpenNewPage = value
            End Set
        End Property
    
        Private _Referer As String = ""
        Public Property Referer() As String
            Get
                Return _Referer
            End Get
            Set(ByVal value As String)
                _Referer = value
            End Set
        End Property
    
    End Class
    

    and the HTML of Redirector.asp

    <script type="text/javascript">
        window.open('<%=Me.OpenNewPage%>', '_blank', '');
        window.document.location.href = '<%=Me.Referer%>';
    </script>
    

    It’s not really really elegant code but it does the trick.
    Obviously, if javascript is disabled it doesn’t work.

    I’ve put together a sample here.
    Hope it helps.

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

Sidebar

Related Questions

Can anybody suggest how we can open the page in new window or New
Possible Duplicate: Can anybody suggest the best image resize script in php? I'm still
I'm using Class based generic views, can anybody suggest me how can i set
Can anybody give any working example of how to read/write Unicode text files using
Could anybody suggest a good open source (as in I can see the source,
This is the link to my form window Can anybody suggest how to customize
I am new to Rails Testing . Can anybody suggest a good reference link
Can anybody suggest how to host a web2py app? I know that google app
can anybody suggest a framework for developing mobile applications using html5 ? I want
Can anybody suggest which is the best way for using NSArray as two-dimensional array

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.