banner ad
ASP.NET Forums/Advanced ASP.NET/Mobile and Handheld Devices/Mobile TextBox Focus

Mobile TextBox Focus[Answered] RSS

4 replies

Last post Nov 10, 2009 11:04 AM by SKT_01

Please mark as answer if you find this useful.

Thanking You
Tapan Rami
  • freezer27 freezer27


    0 Points

    9 Posts

    Re: Mobile TextBox Focus

    Jul 24, 2009 05:28 PM|freezer27|LINK

    <div> The question is: How can I implement that code in a mobile web form (aspx)?

    This link shows a solution:

    but doesn't work at mobile aspx, only standard form.
    Actually, I'm testing my mobile web application at any PocketPC, with Windows Mobile 4.2 and 5.0.

    For example:

    protected void Page_Load(object sender, EventArgs e)

    This code works in standard web form, but throws an exception (System.NullReferenceException) in a mobile webform, so, I modify this code at:

    while (!(p is System.Web.UI.MobileControls.TextBox)) p = p.Parent;

    The exception disapears, but the focus doesn't work.
    Please, I need an answer :'(
    My email is freezer27@gmail. com </div>
  • 3amoor 3amoor


    0 Points

    1 Post

    Re: Mobile TextBox Focus

    Nov 10, 2009 01:17 AM|3amoor|LINK

    someone please explain the solution to this... i can't find any answer... i need to set focus on a textbox with asp mobile... i tried everything i could find on the net and it still doesn't work... if anyone got it working please explain!!!!!!!!

    thanks in advance!

    mobile content ASP.NET Mobile Controls Mobile controls httpbrowsercapabilities ismobiledevice mobile control focus .NET mobile Mobile Controls Panel Mobile Device mobile javascript ASP.NET Mobile

  • SKT_01 SKT_01


    1154 Points

    429 Posts

    Re: Mobile TextBox Focus

    Nov 10, 2009 11:04 AM|SKT_01|LINK


    add the following code to a Mobile Web Form:


    <mobile:DeviceSpecific ID="DeviceSpecific2" Runat="server">
                <Choice Filter="supportsJavaScript" Xmlns="">
                       <script type="text/javascript">
                           window.onload = function() {


  • ‹ Previous Thread|Next Thread ›