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. fire an event for an image in gridview template column

fire an event for an image in gridview template column

Scheduled Pinned Locked Moved ASP.NET
sysadmindockertutorial
3 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.
  • V Offline
    V Offline
    VanithaVasu
    wrote on last edited by
    #1

    How to fire an event when i click the image. protected void GridView1_onImagePress(object sender,ImageEventArgs e) { } ' target="none" runat="server"> ![<% #DataBinder.Eval(Container.DataItem,"ImagePath")%>]]>](<% #DataBinder.Eval(Container.DataItem,"ImagePath")>) ]]>' width="280" height="330" src='<% #DataBinder.Eval(Container.DataItem,"ImagePath")>' id="img1" runat="server" /> .

    VanithaVasu

    E C 2 Replies Last reply
    0
    • V VanithaVasu

      How to fire an event when i click the image. protected void GridView1_onImagePress(object sender,ImageEventArgs e) { } ' target="none" runat="server"> ![<% #DataBinder.Eval(Container.DataItem,"ImagePath")%>]]>](<% #DataBinder.Eval(Container.DataItem,"ImagePath")>) ]]>' width="280" height="330" src='<% #DataBinder.Eval(Container.DataItem,"ImagePath")>' id="img1" runat="server" /> .

      VanithaVasu

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      You should jus put the image inside a link or inside a button then use the onlclick from there

      1 Reply Last reply
      0
      • V VanithaVasu

        How to fire an event when i click the image. protected void GridView1_onImagePress(object sender,ImageEventArgs e) { } ' target="none" runat="server"> ![<% #DataBinder.Eval(Container.DataItem,"ImagePath")%>]]>](<% #DataBinder.Eval(Container.DataItem,"ImagePath")>) ]]>' width="280" height="330" src='<% #DataBinder.Eval(Container.DataItem,"ImagePath")>' id="img1" runat="server" /> .

        VanithaVasu

        C Offline
        C Offline
        Chetan Patel
        wrote on last edited by
        #3

        give commandArgument to image button. protected void Image1_Click(object sender,ImageEventArgs e) { string s = Image1.CommandArgument.toString(); }

        Best Regards, Chetan Patel

        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