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. Capture enter key in textbox

Capture enter key in textbox

Scheduled Pinned Locked Moved ASP.NET
helpquestion
6 Posts 4 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.
  • R Offline
    R Offline
    RohiniTalks
    wrote on last edited by
    #1

    I have a textbox and a button. When i enter something in textbox and press "enter" key, i need to fire the button's click event. Can anyone pls help?

    S N 2 Replies Last reply
    0
    • R RohiniTalks

      I have a textbox and a button. When i enter something in textbox and press "enter" key, i need to fire the button's click event. Can anyone pls help?

      S Offline
      S Offline
      simsen
      wrote on last edited by
      #2

      Wrap a panel around these two controls and then in the Panel write this: DefaultButton="YourButtonIdHere"

      R 1 Reply Last reply
      0
      • R RohiniTalks

        I have a textbox and a button. When i enter something in textbox and press "enter" key, i need to fire the button's click event. Can anyone pls help?

        N Offline
        N Offline
        Nishant Singh
        wrote on last edited by
        #3

        Set it as Default submit button for the form <form id="form1" runat="server" defaultbutton="Button2">

        R 1 Reply Last reply
        0
        • S simsen

          Wrap a panel around these two controls and then in the Panel write this: DefaultButton="YourButtonIdHere"

          R Offline
          R Offline
          RohiniTalks
          wrote on last edited by
          #4

          Thanks for the reply. But unfortunately it doesnt work. Any other ideas?

          1 Reply Last reply
          0
          • N Nishant Singh

            Set it as Default submit button for the form <form id="form1" runat="server" defaultbutton="Button2">

            R Offline
            R Offline
            RohiniTalks
            wrote on last edited by
            #5

            Thanks. But the page is a content holder. So I couldnot use the Form tag.

            H 1 Reply Last reply
            0
            • R RohiniTalks

              Thanks. But the page is a content holder. So I couldnot use the Form tag.

              H Offline
              H Offline
              HugoGonc
              wrote on last edited by
              #6

              Me.Page.Form.DefaultButton = "ControlID"

              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