How do I get the ID of the textbox that has focus on an ASP.NET WebPage

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dougmcmurtry@gmail.com

    How do I get the ID of the textbox that has focus on an ASP.NET WebPage

    I have a web app that is going on a touch screen computer with no
    keyboard, so I have to allow them to enter numeric data into text
    fields through a UserControl that I built. All I need to find is which
    textbox control on the page has focus so I know where to put the
    input. Any ideas? Thanks all......
  • clintonG

    #2
    Re: How do I get the ID of the textbox that has focus on an ASP.NET Web Page

    Determine the type of each object raising each event on the form. If its a
    TextBox object get the ID.

    <%= Clinton Gallagher

    <dougmcmurtry@g mail.comwrote in message
    news:3a06e787-284c-41c3-8fd8-a1672dcee69d@m3 4g2000hsc.googl egroups.com...
    >I have a web app that is going on a touch screen computer with no
    keyboard, so I have to allow them to enter numeric data into text
    fields through a UserControl that I built. All I need to find is which
    textbox control on the page has focus so I know where to put the
    input. Any ideas? Thanks all......

    Comment

    • dougmcmurtry@gmail.com

      #3
      Re: How do I get the ID of the textbox that has focus on an ASP.NETWeb Page

      Great, thanks so much! I'll give that a try, but there might be a
      stumbling point since I am using AJAX. Any suggestions?

      Comment

      • clintonG

        #4
        Re: How do I get the ID of the textbox that has focus on an ASP.NET Web Page

        I erred. Yes, in fact your client-side code will be written in JavaScript to
        get the focus of the control on the client.

        <%= Clinton Gallagher

        <dougmcmurtry@g mail.comwrote in message
        news:74417b7a-df96-4a9a-ada6-662120a1ec73@f6 3g2000hsf.googl egroups.com...
        Great, thanks so much! I'll give that a try, but there might be a
        stumbling point since I am using AJAX. Any suggestions?

        Comment

        • clintonG

          #5
          Re: How do I get the ID of the textbox that has focus on an ASP.NET Web Page

          AJAX is all client-side code and has nothing to do with what you need to do
          with server-side code. What are you working on, a digital signage project?


          <%= Clinton Gallagher



          <dougmcmurtry@g mail.comwrote in message
          news:74417b7a-df96-4a9a-ada6-662120a1ec73@f6 3g2000hsf.googl egroups.com...
          Great, thanks so much! I'll give that a try, but there might be a
          stumbling point since I am using AJAX. Any suggestions?

          Comment

          Working...