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. Pop up window from gridview

Pop up window from gridview

Scheduled Pinned Locked Moved ASP.NET
javascriptdatabasehelpquestion
9 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.
  • C Offline
    C Offline
    ChrisFarrugia
    wrote on last edited by
    #1

    Dear All, I am using the gridview to display a list equipment from database. One of the columns in the database is manufacturer_url. Now I want the data in this field to be displayed as a hyperlink in gridview and when clicked it opens a pop up window. Is there a way to do this by incorporating the javascript:open or any other way? Thank you very much for your great help! Chris Farrugi

    D A 2 Replies Last reply
    0
    • C ChrisFarrugia

      Dear All, I am using the gridview to display a list equipment from database. One of the columns in the database is manufacturer_url. Now I want the data in this field to be displayed as a hyperlink in gridview and when clicked it opens a pop up window. Is there a way to do this by incorporating the javascript:open or any other way? Thank you very much for your great help! Chris Farrugi

      D Offline
      D Offline
      Deepak the Cool
      wrote on last edited by
      #2

      Use the following code for popUp in and use tag rather than Hyperlink... [')" style="color:Maroon" >View Profile](javascript:winOpen('<%# ) now goto your popup window page_load event and get the above "YourKey" from QueryString. and do that what yuo want to your popup window.Fetch records from the DB by above define "YourKey"...... and write the following Jscript function into ur girdview aspx page: function winOpen(URL) { window.open(URL, 'Default','width=550,height=520,toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=yes, copyhistory=yes,resizable=no,left=250,top=100,screenX=0,screenY=0'); } :) -- modified at 2:05 Tuesday 28th August, 2007 -- modified at 2:07 Tuesday 28th August, 2007 -- modified at 2:20 Tuesday 28th August, 2007 Deepak Smile a Lots,Its Costs Nothing -- modified at 2:21 Tuesday 28th August, 2007

      C 1 Reply Last reply
      0
      • D Deepak the Cool

        Use the following code for popUp in and use tag rather than Hyperlink... [')" style="color:Maroon" >View Profile](javascript:winOpen('<%# ) now goto your popup window page_load event and get the above "YourKey" from QueryString. and do that what yuo want to your popup window.Fetch records from the DB by above define "YourKey"...... and write the following Jscript function into ur girdview aspx page: function winOpen(URL) { window.open(URL, 'Default','width=550,height=520,toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=yes, copyhistory=yes,resizable=no,left=250,top=100,screenX=0,screenY=0'); } :) -- modified at 2:05 Tuesday 28th August, 2007 -- modified at 2:07 Tuesday 28th August, 2007 -- modified at 2:20 Tuesday 28th August, 2007 Deepak Smile a Lots,Its Costs Nothing -- modified at 2:21 Tuesday 28th August, 2007

        C Offline
        C Offline
        ChrisFarrugia
        wrote on last edited by
        #3

        Thank you for your reply! So let me see if i understod you correctly. 1. Which tag do I use in the gridview columns. The hyperlink ? 2. So I get the identity of the row and then pass it to another aspx page and from there i retrieve the id from querystring and perform the window operations from that page. Thank you very much Chris

        D 1 Reply Last reply
        0
        • C ChrisFarrugia

          Thank you for your reply! So let me see if i understod you correctly. 1. Which tag do I use in the gridview columns. The hyperlink ? 2. So I get the identity of the row and then pass it to another aspx page and from there i retrieve the id from querystring and perform the window operations from that page. Thank you very much Chris

          D Offline
          D Offline
          Deepak the Cool
          wrote on last edited by
          #4

          i already posted for that but i can't able to show u HTML tags in this text editor.. i m trying for that....if u hav tricks for how i can write the html in this text editor thn tell me...

          Deepak Smile a Lots,Its Costs Nothing

          C 1 Reply Last reply
          0
          • C ChrisFarrugia

            Dear All, I am using the gridview to display a list equipment from database. One of the columns in the database is manufacturer_url. Now I want the data in this field to be displayed as a hyperlink in gridview and when clicked it opens a pop up window. Is there a way to do this by incorporating the javascript:open or any other way? Thank you very much for your great help! Chris Farrugi

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

            do like.. to open popup window Response.Write("window.open('[Path]',null,'left=150, top=150, height=320, width= 620, status= no, resizable= no, scrollbars= no, toolbar= no,location= no, menubar= no');"); do this in rowcommand event of gridview on click of ur hyperlink.

            ChrisFarrugia wrote:

            I want the data in this field to be displayed as a hyperlink in gridview

            to do this simply use Eval("[ur field name from db]") and bind it to ur hyperlink

            Amit Metkar 3i-infotech, Mumbai.

            C 1 Reply Last reply
            0
            • D Deepak the Cool

              i already posted for that but i can't able to show u HTML tags in this text editor.. i m trying for that....if u hav tricks for how i can write the html in this text editor thn tell me...

              Deepak Smile a Lots,Its Costs Nothing

              C Offline
              C Offline
              ChrisFarrugia
              wrote on last edited by
              #6

              In the text editor there is a checkbox...exlucde html tags or something like that. Thanks a lot. Chris

              1 Reply Last reply
              0
              • A Amit Amit Amit

                do like.. to open popup window Response.Write("window.open('[Path]',null,'left=150, top=150, height=320, width= 620, status= no, resizable= no, scrollbars= no, toolbar= no,location= no, menubar= no');"); do this in rowcommand event of gridview on click of ur hyperlink.

                ChrisFarrugia wrote:

                I want the data in this field to be displayed as a hyperlink in gridview

                to do this simply use Eval("[ur field name from db]") and bind it to ur hyperlink

                Amit Metkar 3i-infotech, Mumbai.

                C Offline
                C Offline
                ChrisFarrugia
                wrote on last edited by
                #7

                Amit.Amit.Amit..... wrote:

                ChrisFarrugia wrote: I want the data in this field to be displayed as a hyperlink in gridview to do this simply use Eval("[ur field name from db]") and bind it to ur hyperlink

                But that wont open a hyperlink. That just displays the link and when clicked it redirects to that page. My problem is how to bind the data from db to a hyperlink BUT when clicked it opens a popup window. Thank you a lot for your great help, Chris

                A 1 Reply Last reply
                0
                • C ChrisFarrugia

                  Amit.Amit.Amit..... wrote:

                  ChrisFarrugia wrote: I want the data in this field to be displayed as a hyperlink in gridview to do this simply use Eval("[ur field name from db]") and bind it to ur hyperlink

                  But that wont open a hyperlink. That just displays the link and when clicked it redirects to that page. My problem is how to bind the data from db to a hyperlink BUT when clicked it opens a popup window. Thank you a lot for your great help, Chris

                  A Offline
                  A Offline
                  Amit Amit Amit
                  wrote on last edited by
                  #8

                  dont use hyperlink. use linkbutton so that u will get in rowcommand event after clicking to linkbutton.dont forget to set commandname property of linkbutton.

                  Amit Metkar 3i-infotech, Mumbai.

                  C 1 Reply Last reply
                  0
                  • A Amit Amit Amit

                    dont use hyperlink. use linkbutton so that u will get in rowcommand event after clicking to linkbutton.dont forget to set commandname property of linkbutton.

                    Amit Metkar 3i-infotech, Mumbai.

                    C Offline
                    C Offline
                    ChrisFarrugia
                    wrote on last edited by
                    #9

                    Thanks a lot for your help! I will try it out today and let you know :) Should you need any help in future contact me. Thanks Chris

                    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