1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Using image button in gridview

Discussion in 'C#' started by pHrEaK, Aug 20, 2012.

  1. #1
    I've got a gridview setup that has an image button in the first column of every record. I'm wanting this image button to whenever clicked send the primary key value for that record back to the code behind page.

    I guess what I am asking is what would be the best way to accomplish this? I've thought of a way to do it using javascript but I know there has to be an easier way...I'm fairly new to asp.net....also this is using vb

    Any suggestions greatly appreciated!
    SEMrush
     
    pHrEaK, Aug 20, 2012 IP
    SEMrush
  2. fortunechanger

    fortunechanger Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can add template field in the grid view and then add asp:imagebutton in the itemtemplate this is the way to add imagebutton in the grid
     
    fortunechanger, Aug 26, 2012 IP
  3. abhishekabhi

    abhishekabhi Greenhorn

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #3
    HI

    Image button use for show image in gridview.
     
    abhishekabhi, Sep 8, 2012 IP
  4. TayyabRazaq

    TayyabRazaq Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Its Done by adding a template column
     
    TayyabRazaq, Dec 10, 2012 IP
  5. Saleem458

    Saleem458 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi,We can add in template field and in item filed inside template field
     
    Saleem458, Dec 11, 2012 IP
  6. agitetech

    agitetech Peon

    Messages:
    122
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It can be done by adding the template field in the grid view and than add item template into template field after that you will be able put the image button into the grid view...
     
    agitetech, Dec 14, 2012 IP