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 URL in new browser window

How to open URL in new browser window

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
6 Posts 6 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 application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance

    D S A G C 5 Replies Last reply
    0
    • N Nekkantidivya

      Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #2

      Read the HTML basics at W3Schools[^]

      1 Reply Last reply
      0
      • N Nekkantidivya

        Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance

        S Offline
        S Offline
        sumit7034
        wrote on last edited by
        #3

        you can use java script to do this. :)

        1 Reply Last reply
        0
        • N Nekkantidivya

          Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance

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

          use javascript:window.open('url')

          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
          • N Nekkantidivya

            Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance

            G Offline
            G Offline
            Gamzun
            wrote on last edited by
            #5

            You can even use ASP.Net's LinkButton and set its property target to _blank

            Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif

            1 Reply Last reply
            0
            • N Nekkantidivya

              Hi, I am working on a Asp.net application in this on button click I need to open a URL in a new browser window of height=300 and width=500. If anyone have any idea to do this please reply me. Thanks in Advance

              C Offline
              C Offline
              Christopher Duncan
              wrote on last edited by
              #6

              Of course, when you're using a hyperlink or a linkbutton you can just set the target, and of course as others have mentioned, there's always javascript. That said, if you really need to use a button, or any other scenario where you want a new window to be fired up from an event handler in your code, this trick might be helpful. On your page (or on your master page) find the form by its ID: HtmlForm frm = Page.FindControl("YourFormID") as HtmlForm; if (null != frm) { // this will cause the links to open in a new window frm.Target = "_blank"; } Hope this helps -

              Christopher Duncan www.PracticalUSA.com Author of The Career Programmer and Unite the Tribes Copywriting Services

              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