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. problem with buttons

problem with buttons

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelpquestion
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.
  • M Offline
    M Offline
    Mr Cully
    wrote on last edited by
    #1

    if i put a button on my asp.net page and then click enter in a text box for wxample, it clicks the button and does the action attached to it... annoying, how do i stop this ps. i know its a really dumb qeastion

    J 1 Reply Last reply
    0
    • M Mr Cully

      if i put a button on my asp.net page and then click enter in a text box for wxample, it clicks the button and does the action attached to it... annoying, how do i stop this ps. i know its a really dumb qeastion

      J Offline
      J Offline
      John Kuhn
      wrote on last edited by
      #2

      Mr. Cully wrote: i know its a really dumb qeastion Not really -- at least I didn't know the whole answer. Apparently, the ENTER key always causes a page to submit; so, the work-around is to either a) use ASP.NET Validators (RequiredFieldValidator, for example) that catches empty fields, etc., or b) stop the ENTER key completely. I found an example of cancelling the ENTER key here[^]. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

      T 1 Reply Last reply
      0
      • J John Kuhn

        Mr. Cully wrote: i know its a really dumb qeastion Not really -- at least I didn't know the whole answer. Apparently, the ENTER key always causes a page to submit; so, the work-around is to either a) use ASP.NET Validators (RequiredFieldValidator, for example) that catches empty fields, etc., or b) stop the ENTER key completely. I found an example of cancelling the ENTER key here[^]. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

        T Offline
        T Offline
        T Manjaly
        wrote on last edited by
        #3

        A related article : http://www.dotnetspider.com/Technology/KBPages/212.aspx :zzz:----------------------------------------------------------------------:(( T Manjaly C# Tutorials and samples : http://www.dotnetspider.com

        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