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. <img> onclick event</img>

<img> onclick event</img>

Scheduled Pinned Locked Moved Web Development
questioncsharpjavascripthtml
4 Posts 2 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
    sarah_chandran
    wrote on last edited by
    #1

    How can I call a c# method from a html image tag onclick event? I don't want to use a imagebutton, is there a way I can do it with javascript i.e. can i call a javascript function and then call the c# code from there? Can u send some sample code

    V 1 Reply Last reply
    0
    • S sarah_chandran

      How can I call a c# method from a html image tag onclick event? I don't want to use a imagebutton, is there a way I can do it with javascript i.e. can i call a javascript function and then call the c# code from there? Can u send some sample code

      V Offline
      V Offline
      vaghelabhavesh
      wrote on last edited by
      #2

      sarah_chandran wrote:

      html image tag onclick event

      Html img tag onclick event is an client side event and it can not call server side method unless you use dopostback with eventarguments or AJAX.

      S 1 Reply Last reply
      0
      • V vaghelabhavesh

        sarah_chandran wrote:

        html image tag onclick event

        Html img tag onclick event is an client side event and it can not call server side method unless you use dopostback with eventarguments or AJAX.

        S Offline
        S Offline
        sarah_chandran
        wrote on last edited by
        #3

        Couold u please show me some sample code of how to do it with ajax?

        V 1 Reply Last reply
        0
        • S sarah_chandran

          Couold u please show me some sample code of how to do it with ajax?

          V Offline
          V Offline
          vaghelabhavesh
          wrote on last edited by
          #4

          I replied here. http://www.codeproject.com/script/Forums/View.aspx?fid=12076&msg=2908867[^]

          Books are as useful to a stupid person as a mirror is useful to a blind person. - Chanakya

          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