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. Linked image in DataGrid

Linked image in DataGrid

Scheduled Pinned Locked Moved ASP.NET
databasesql-serversysadmin
12 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 nour123

    Hi all I have a datagrid, which holds item name, item price, and its image(all from SQL Server database), what I need is when the user clicks on the image, I need the (id) for the item to be carried to the new page where I want to show more details about the item (expiry date, ...) thanks alot...

    J Offline
    J Offline
    jegastar
    wrote on last edited by
    #2

    Hi, Add "A href" tag with in your DataGrid code and attach the Id which is binded from the database table. Use the following code in the DataGrid code block. Or otherwise just give me your complete DataGrid script, I wiil give you the modified code. Regards, Jegastar D.

    N 4 Replies Last reply
    0
    • J jegastar

      Hi, Add "A href" tag with in your DataGrid code and attach the Id which is binded from the database table. Use the following code in the DataGrid code block. Or otherwise just give me your complete DataGrid script, I wiil give you the modified code. Regards, Jegastar D.

      N Offline
      N Offline
      nour123
      wrote on last edited by
      #3

      Hi Dear... you didn't attach me the grid code block... thanks alot and have a nice day

      1 Reply Last reply
      0
      • N nour123

        Hi all I have a datagrid, which holds item name, item price, and its image(all from SQL Server database), what I need is when the user clicks on the image, I need the (id) for the item to be carried to the new page where I want to show more details about the item (expiry date, ...) thanks alot...

        G Offline
        G Offline
        gauthee
        wrote on last edited by
        #4

        as said in the other reply you can use href and provide the link for the new page, at the same time append the url with the required data you want to send ex:webform1.aspx?id= value and to use this value you can use Request.QueryString["id"] in the other page.

        Gautham

        N 1 Reply Last reply
        0
        • J jegastar

          Hi, Add "A href" tag with in your DataGrid code and attach the Id which is binded from the database table. Use the following code in the DataGrid code block. Or otherwise just give me your complete DataGrid script, I wiil give you the modified code. Regards, Jegastar D.

          N Offline
          N Offline
          nour123
          wrote on last edited by
          #5

          Hi dear an error occurs, it tells me that cannot be with columnt tag: here is my code (where to put a href?): thanks alot

          1 Reply Last reply
          0
          • J jegastar

            Hi, Add "A href" tag with in your DataGrid code and attach the Id which is binded from the database table. Use the following code in the DataGrid code block. Or otherwise just give me your complete DataGrid script, I wiil give you the modified code. Regards, Jegastar D.

            N Offline
            N Offline
            nour123
            wrote on last edited by
            #6

            Hi dear an error occurs, it tells me that cannot be with columnt tag: here is my code (where to put a href?): thanks alot

            J 2 Replies Last reply
            0
            • G gauthee

              as said in the other reply you can use href and provide the link for the new page, at the same time append the url with the required data you want to send ex:webform1.aspx?id= value and to use this value you can use Request.QueryString["id"] in the other page.

              Gautham

              N Offline
              N Offline
              nour123
              wrote on last edited by
              #7

              Hi dear I know that, but an error occurs that tells me: cannot put the a href tag inside the columns tag, could you please attach me a small sample? nour_fa@yahoo.com thanks alot

              1 Reply Last reply
              0
              • J jegastar

                Hi, Add "A href" tag with in your DataGrid code and attach the Id which is binded from the database table. Use the following code in the DataGrid code block. Or otherwise just give me your complete DataGrid script, I wiil give you the modified code. Regards, Jegastar D.

                N Offline
                N Offline
                nour123
                wrote on last edited by
                #8

                Please send me a sample code, the a href tag does an error when added in columns of datagrid... Regards

                1 Reply Last reply
                0
                • N nour123

                  Hi dear an error occurs, it tells me that cannot be with columnt tag: here is my code (where to put a href?): thanks alot

                  J Offline
                  J Offline
                  jegastar
                  wrote on last edited by
                  #9

                  Hi, With in the href tag I have attached an Image control. Previously i attached the code. But I do not know why it does not visible. -----Jegastar D.

                  1 Reply Last reply
                  0
                  • N nour123

                    Hi dear an error occurs, it tells me that cannot be with columnt tag: here is my code (where to put a href?): thanks alot

                    J Offline
                    J Offline
                    jegastar
                    wrote on last edited by
                    #10

                    Hi, With in the href tag I have attached an Image control. Previously i attached the code. But I do not know why it does not visible. Here PM_Id and PM_Picture1 are field names in sql server database table. When you press the image you can go to next page carrying with the Id in through URL. -----Jegastar D.

                    J 1 Reply Last reply
                    0
                    • J jegastar

                      Hi, With in the href tag I have attached an Image control. Previously i attached the code. But I do not know why it does not visible. Here PM_Id and PM_Picture1 are field names in sql server database table. When you press the image you can go to next page carrying with the Id in through URL. -----Jegastar D.

                      J Offline
                      J Offline
                      jegastar
                      wrote on last edited by
                      #11

                      Still code is not visible. Give me your email Id. I shall send the code through it. Jegastar D.

                      N 1 Reply Last reply
                      0
                      • J jegastar

                        Still code is not visible. Give me your email Id. I shall send the code through it. Jegastar D.

                        N Offline
                        N Offline
                        nour123
                        wrote on last edited by
                        #12

                        Hi dear I'm very sorry to make headache for you, my email is: nour_fa@yahoo.com please send me the form an the html code Thanks alot...

                        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