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. Catpuring Button Press In A WebForm

Catpuring Button Press In A WebForm

Scheduled Pinned Locked Moved ASP.NET
c++htmlcomquestion
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.
  • Z Offline
    Z Offline
    Zachery
    wrote on last edited by
    #1

    I have a WebForm and I need a way to set what button event is fired upon the press of a key(specifically the Enter key), I tired TabIndex, is it something to do with the AccessKey? Thanks in Advance .............Zack............. Developer Extraordinaire "It's all about function over form. I mean, look at NASA. Their code isn't formatted correctly and their stuff looks crappy, but, they'll get you to the moon." GCS\P\SS d- s-:- a-- C++$ U--- P--- L- E- W++ N o K-? w+++ O++ !M-- V PS+ PE Y+ PGP t+ 5+ X+ R++ tv++ b++ DI++ D+++ G+>G++++ e* h- r++ y+

    A V 2 Replies Last reply
    0
    • Z Zachery

      I have a WebForm and I need a way to set what button event is fired upon the press of a key(specifically the Enter key), I tired TabIndex, is it something to do with the AccessKey? Thanks in Advance .............Zack............. Developer Extraordinaire "It's all about function over form. I mean, look at NASA. Their code isn't formatted correctly and their stuff looks crappy, but, they'll get you to the moon." GCS\P\SS d- s-:- a-- C++$ U--- P--- L- E- W++ N o K-? w+++ O++ !M-- V PS+ PE Y+ PGP t+ 5+ X+ R++ tv++ b++ DI++ D+++ G+>G++++ e* h- r++ y+

      A Offline
      A Offline
      Andy Smith
      wrote on last edited by
      #2

      To associate button click events with a postback caused by pressing enter, use my DefaultButtons control.

      1 Reply Last reply
      0
      • Z Zachery

        I have a WebForm and I need a way to set what button event is fired upon the press of a key(specifically the Enter key), I tired TabIndex, is it something to do with the AccessKey? Thanks in Advance .............Zack............. Developer Extraordinaire "It's all about function over form. I mean, look at NASA. Their code isn't formatted correctly and their stuff looks crappy, but, they'll get you to the moon." GCS\P\SS d- s-:- a-- C++$ U--- P--- L- E- W++ N o K-? w+++ O++ !M-- V PS+ PE Y+ PGP t+ 5+ X+ R++ tv++ b++ DI++ D+++ G+>G++++ e* h- r++ y+

        V Offline
        V Offline
        Vasudevan Deepak Kumar
        wrote on last edited by
        #3

        Hi, I actually had a similar problem and circumvented it with a JavaScript trick. First you need to cut the wireup that VS.NET puts for ASP Buttons. Use HtmlButtons only. ON ButtonClick and Enter Button, call a generic JavaScript function, set a hidden field to a specified value 'add', 'update', 'delete', 'change' etc. and then submit the form. The control will goto PageLoad. Now in PageLoad, If (Postback) check for the value of hidden field and execute that method now. Did this solve the problem. Alternatively, you can create a Button Control and use that instead of the default ASP Buttons and HtmlButtons too. That is more elegant, though, the first time, time investment, it takes to create is more. Deepak Kumar Vasudevan http://deepak.portland.co.uk/

        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