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. openenig document in different window

openenig document in different window

Scheduled Pinned Locked Moved ASP.NET
sysadmintutorialquestion
9 Posts 5 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.
  • S Offline
    S Offline
    Sandeep Akhare
    wrote on last edited by
    #1

    Hi All I am developing the Search Engine that is working properly and returning the path of files(store in directory at server ) . Now i want to display FileName as url and whenever userclick that url the Document/file should be open in new window . Which control should i use for hyperlink ? HyperLink, LinkButton or simple tag Can any one tell me how to open a document in different window ?

    Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

    C B T 3 Replies Last reply
    0
    • S Sandeep Akhare

      Hi All I am developing the Search Engine that is working properly and returning the path of files(store in directory at server ) . Now i want to display FileName as url and whenever userclick that url the Document/file should be open in new window . Which control should i use for hyperlink ? HyperLink, LinkButton or simple tag Can any one tell me how to open a document in different window ?

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      C Offline
      C Offline
      Chetan Ranpariya
      wrote on last edited by
      #2

      Hi, You can use and set its Target property to "_blank" and its NavigateUrl property to the file url and done!!!!!!!!!!!!!!!!!. I hope this will help you. -- modified at 6:56 Friday 8th June, 2007 Thanks and Regards, Chetan Ranpariya

      S 1 Reply Last reply
      0
      • S Sandeep Akhare

        Hi All I am developing the Search Engine that is working properly and returning the path of files(store in directory at server ) . Now i want to display FileName as url and whenever userclick that url the Document/file should be open in new window . Which control should i use for hyperlink ? HyperLink, LinkButton or simple tag Can any one tell me how to open a document in different window ?

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        B Offline
        B Offline
        badgrs
        wrote on last edited by
        #3

        Add the target="_blank" attribute to the link.

        1 Reply Last reply
        0
        • S Sandeep Akhare

          Hi All I am developing the Search Engine that is working properly and returning the path of files(store in directory at server ) . Now i want to display FileName as url and whenever userclick that url the Document/file should be open in new window . Which control should i use for hyperlink ? HyperLink, LinkButton or simple tag Can any one tell me how to open a document in different window ?

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          T Offline
          T Offline
          Tom John
          wrote on last edited by
          #4

          Are you trying to do this after a postback or from a regular link? Regular link: The Code Project Code Behind: You'll need to register a client startup script to open the new window once the page has loaded: Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click Page.ClientScript.RegisterStartupScript(Me.GetType, "codeProjectRedirect", "window.open('http://www.codeproject.com')", True) End Sub `Hope this helps Tom -- modified at 13:41 Friday 8th June, 2007`

          S 1 Reply Last reply
          0
          • T Tom John

            Are you trying to do this after a postback or from a regular link? Regular link: The Code Project Code Behind: You'll need to register a client startup script to open the new window once the page has loaded: Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click Page.ClientScript.RegisterStartupScript(Me.GetType, "codeProjectRedirect", "window.open('http://www.codeproject.com')", True) End Sub `Hope this helps Tom -- modified at 13:41 Friday 8th June, 2007`

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            Tom John wrote:

            client startup script to open the new window once the page has loaded:

            How will it open if have only path of directory such as C://Albums/FilaName.txt store at the server side Its not a website page i think its bit clear now

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            V 1 Reply Last reply
            0
            • C Chetan Ranpariya

              Hi, You can use and set its Target property to "_blank" and its NavigateUrl property to the file url and done!!!!!!!!!!!!!!!!!. I hope this will help you. -- modified at 6:56 Friday 8th June, 2007 Thanks and Regards, Chetan Ranpariya

              S Offline
              S Offline
              Sandeep Akhare
              wrote on last edited by
              #6

              Chetan Ranpariya wrote:

              Target property to "_blank" and its NavigateUrl property

              Are you suggesting HyperLink Control ?

              Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

              C 1 Reply Last reply
              0
              • S Sandeep Akhare

                Chetan Ranpariya wrote:

                Target property to "_blank" and its NavigateUrl property

                Are you suggesting HyperLink Control ?

                Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                C Offline
                C Offline
                Chetan Ranpariya
                wrote on last edited by
                #7

                Hi, You r right. I m suggesting you to use hyperlink control.

                Thanks and Regards, Chetan Ranpariya

                1 Reply Last reply
                0
                • S Sandeep Akhare

                  Tom John wrote:

                  client startup script to open the new window once the page has loaded:

                  How will it open if have only path of directory such as C://Albums/FilaName.txt store at the server side Its not a website page i think its bit clear now

                  Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                  V Offline
                  V Offline
                  Venkatesh Mookkan
                  wrote on last edited by
                  #8

                  Sandeep Akhare wrote:

                  How will it open if have only path of directory such as C://Albums/FilaName.txt store at the server side Its not a website page

                  It depends on the MIME type man... Text files normally open directly into the IE.

                  Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group | Blog Spot

                  S 1 Reply Last reply
                  0
                  • V Venkatesh Mookkan

                    Sandeep Akhare wrote:

                    How will it open if have only path of directory such as C://Albums/FilaName.txt store at the server side Its not a website page

                    It depends on the MIME type man... Text files normally open directly into the IE.

                    Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group | Blog Spot

                    S Offline
                    S Offline
                    Sandeep Akhare
                    wrote on last edited by
                    #9

                    Yes but the problem is that the its a web application and client will not be able to open a file untill it is in Virtual directory or it is in current application folder .......... Link having url of any file in server will not open in this way

                    Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                    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