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. <Input type='image'> posts back automatically

<Input type='image'> posts back automatically

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

    Hello, I noticed that when I have an input type of image (html control) it automatically posts back when I click it, even though I am not running it as a server control. But a regular input button (html control) does not automatically post back. Does anybody know why the image input posts back? Is there another way to do create a client side image button that will not automatically post back? Any insight on how this stuff works is greatly appreciated. Thanks, RC

    M 1 Reply Last reply
    0
    • C chubbysilk

      Hello, I noticed that when I have an input type of image (html control) it automatically posts back when I click it, even though I am not running it as a server control. But a regular input button (html control) does not automatically post back. Does anybody know why the image input posts back? Is there another way to do create a client side image button that will not automatically post back? Any insight on how this stuff works is greatly appreciated. Thanks, RC

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      The element creates an image control, when clicked, causes the form to be immediately submited. Have a look at 'Input Image'[^] in MSDN. To solve this thing, you can simply add some scripts on the client side. function Body_OnLoad() { window.document.getElementById("help").onclick = Image_Click; } function Image_Click() { //TO DO: return false; }

      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