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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. window.open function in vb.net1.1 [modified]

window.open function in vb.net1.1 [modified]

Scheduled Pinned Locked Moved ASP.NET
csharp
9 Posts 5 Posters 4 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.
  • A Offline
    A Offline
    amaneet
    wrote on last edited by
    #1

    Sir, Can I use window.open function in vb.net code file and Is there any vb.net function to open the page in new window.Please send the examples. Thanks and Regards Amaneet Brar -- modified at 7:56 Thursday 1st June, 2006

    G N M 3 Replies Last reply
    0
    • A amaneet

      Sir, Can I use window.open function in vb.net code file and Is there any vb.net function to open the page in new window.Please send the examples. Thanks and Regards Amaneet Brar -- modified at 7:56 Thursday 1st June, 2006

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      The window.open method is Javascript, not ASP.NET. You can't use Javascript directly from server code. If you want to add the Javascript to the page, use the RegisterStartupScript method. --- b { font-weight: normal; }

      A 1 Reply Last reply
      0
      • G Guffa

        The window.open method is Javascript, not ASP.NET. You can't use Javascript directly from server code. If you want to add the Javascript to the page, use the RegisterStartupScript method. --- b { font-weight: normal; }

        A Offline
        A Offline
        amaneet
        wrote on last edited by
        #3

        Sir, Please send an example. Thanks and Reagrds Amaneet Brar

        1 Reply Last reply
        0
        • A amaneet

          Sir, Can I use window.open function in vb.net code file and Is there any vb.net function to open the page in new window.Please send the examples. Thanks and Regards Amaneet Brar -- modified at 7:56 Thursday 1st June, 2006

          N Offline
          N Offline
          ngrj
          wrote on last edited by
          #4

          Hi This is one way to open a new window When you click on a button if u want to open a new window then in codebehind button1.attributes.add("onclick","javascript:open()") now in script function open() { window.open(url); } Hope this will help u ngrj

          A G 2 Replies Last reply
          0
          • N ngrj

            Hi This is one way to open a new window When you click on a button if u want to open a new window then in codebehind button1.attributes.add("onclick","javascript:open()") now in script function open() { window.open(url); } Hope this will help u ngrj

            A Offline
            A Offline
            amaneet
            wrote on last edited by
            #5

            Sir, I am using linkbutton and want to call the function in html file on linkbutton click and defining it in code file and passing the path as the arguments in the function and in the code file that path concerned file will get open in new page .Can you please send the code for this. Thanks and Regards Amaneet Brar

            _ 1 Reply Last reply
            0
            • A amaneet

              Sir, Can I use window.open function in vb.net code file and Is there any vb.net function to open the page in new window.Please send the examples. Thanks and Regards Amaneet Brar -- modified at 7:56 Thursday 1st June, 2006

              M Offline
              M Offline
              Mihai Drebot
              wrote on last edited by
              #6

              There is another way: Response.Write("window.open...."); Or you can use a literal control, and write in it a string similar with the one above.

              A 1 Reply Last reply
              0
              • M Mihai Drebot

                There is another way: Response.Write("window.open...."); Or you can use a literal control, and write in it a string similar with the one above.

                A Offline
                A Offline
                amaneet
                wrote on last edited by
                #7

                Sir, There is a path in the function which will be given in the window.open arguments. Can you please send with detail example. Thanks and regards Amaneet Brar

                1 Reply Last reply
                0
                • A amaneet

                  Sir, I am using linkbutton and want to call the function in html file on linkbutton click and defining it in code file and passing the path as the arguments in the function and in the code file that path concerned file will get open in new page .Can you please send the code for this. Thanks and Regards Amaneet Brar

                  _ Offline
                  _ Offline
                  _AK_
                  wrote on last edited by
                  #8

                  Hi, You write a javascript function to open the popup and call that function from code behind, from there you can also pass the parameters to that function. In code behind you can write like this: LinkButton1.Attributes.Add("onclick","javascript:test(str)"); Best Regards, Apurva Kaushal

                  1 Reply Last reply
                  0
                  • N ngrj

                    Hi This is one way to open a new window When you click on a button if u want to open a new window then in codebehind button1.attributes.add("onclick","javascript:open()") now in script function open() { window.open(url); } Hope this will help u ngrj

                    G Offline
                    G Offline
                    Guffa
                    wrote on last edited by
                    #9

                    ngrj wrote:

                    button1.attributes.add("onclick","javascript:open()")

                    A protocol (javascript:) is only needed when you put javascript in an url (e.g. the href property of a link). If you use a protocol in regular Javascript code, it will be interpreted as a label instead. Also, don't give the function the same name as the open method. That will cause the function to call itself instead of the original open method. button1.Attributes.Add("onclick","openWindow();") function openWindow() { window.open(url); } --- b { font-weight: normal; }

                    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