Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to open a url in a new browser window in Ajax page

How to open a url in a new browser window in Ajax page

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-nettoolstutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nekkantidivya
    wrote on last edited by
    #1

    Hi, I am working on a Asp.net project. Here we need to display a URL in a new browser window with custom size like a popup. For this I tried with below code: Page.RegisterStartupScript("New Window", "<script language=JavaScript>window.open('Default.aspx','mywindow','width=500,height=300');</script>"); This is working in all the my project pages. But this is not working in one of my project page where I used Ajax extenders like calender extender, Auto complete extender etc. So I also tried with ClientScript.RegisterClientScript() but eventhen it is not working. If anyone have any idea to solve this please reply me. Thanks in advance.

    A A 2 Replies Last reply
    0
    • N Nekkantidivya

      Hi, I am working on a Asp.net project. Here we need to display a URL in a new browser window with custom size like a popup. For this I tried with below code: Page.RegisterStartupScript("New Window", "<script language=JavaScript>window.open('Default.aspx','mywindow','width=500,height=300');</script>"); This is working in all the my project pages. But this is not working in one of my project page where I used Ajax extenders like calender extender, Auto complete extender etc. So I also tried with ClientScript.RegisterClientScript() but eventhen it is not working. If anyone have any idea to solve this please reply me. Thanks in advance.

      A Offline
      A Offline
      Anurag Gandhi
      wrote on last edited by
      #2

      Can you please tell us what error you are getting? If no error, then have you checked what it appears in View-Source in Browser? Also check if popup is blocked in your browser for that site.

      Anurag Gandhi. http://www.gandhisoft.com Life is a computer program and every one is the programmer of his own life.

      1 Reply Last reply
      0
      • N Nekkantidivya

        Hi, I am working on a Asp.net project. Here we need to display a URL in a new browser window with custom size like a popup. For this I tried with below code: Page.RegisterStartupScript("New Window", "<script language=JavaScript>window.open('Default.aspx','mywindow','width=500,height=300');</script>"); This is working in all the my project pages. But this is not working in one of my project page where I used Ajax extenders like calender extender, Auto complete extender etc. So I also tried with ClientScript.RegisterClientScript() but eventhen it is not working. If anyone have any idea to solve this please reply me. Thanks in advance.

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Instead of ClientScript.RegisterClientScript() use ScriptManager.RegisterStartupScript() when the call is inside UpdatePanel. ;)

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups