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. Keypress event in Asp.net

Keypress event in Asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
4 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.
  • R Offline
    R Offline
    ravihd
    wrote on last edited by
    #1

    How to validate textbox in Asp.net on Keypress, insteed of button click.

    V 1 Reply Last reply
    0
    • R ravihd

      How to validate textbox in Asp.net on Keypress, insteed of button click.

      V Offline
      V Offline
      Vipin d
      wrote on last edited by
      #2

      u can fire some javascript fnc on key press event. for that u add attributes in code behind eg: TxtEmail1.Attributes.Add("OnKeypress", "javascript:email1check(this);") or u can invoke certain button click events All I ever wanted is what others have.... CrazySanker

      R 1 Reply Last reply
      0
      • V Vipin d

        u can fire some javascript fnc on key press event. for that u add attributes in code behind eg: TxtEmail1.Attributes.Add("OnKeypress", "javascript:email1check(this);") or u can invoke certain button click events All I ever wanted is what others have.... CrazySanker

        R Offline
        R Offline
        ravihd
        wrote on last edited by
        #3

        Can u pls tell me is this the r8 way to handle keypress event:confused: txtUserName.Attributes.Add("OnKeypress", "btnOk_Click()") Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click Showbox("I am here", Msg.Warning, plhMainMenu, "Cancel", , , , , "Client Visit") End Sub

        E 1 Reply Last reply
        0
        • R ravihd

          Can u pls tell me is this the r8 way to handle keypress event:confused: txtUserName.Attributes.Add("OnKeypress", "btnOk_Click()") Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click Showbox("I am here", Msg.Warning, plhMainMenu, "Cancel", , , , , "Client Visit") End Sub

          E Offline
          E Offline
          enjoycrack
          wrote on last edited by
          #4

          Nope, the btnOK_Click() funx must be js function...That will be executed at client-side (not server-side as your example) << >>

          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