Asp.Net AutoPostback and control focus

Discussion in 'ASP .Net' started by robin9876@hotmail.com, Jun 21, 2006.

  1. Guest

    In Asp.Net v1.1 web form I have a number of controls which have the
    autopostback enabled. Is it possible after the autopostback has run
    that the control that caused the autopostback to get the focus?
     
    , Jun 21, 2006
    #1
    1. Advertisements

  2. Hi, maybe you can use smartnavigation.
    See http://geekswithblogs.net/ranganh/archive/2005/04/25/37616.aspx

    Note that this solution only works on IE.
    A cross-browser compatible solution is to use shomething like this:
    Page.RegisterClientScriptBlock("focus",
    "document.<id-of-your-control>.focus();")

    --
    Bent Kristiansen
    bent.kristiansen(AT)bekk.no


    "" wrote:

    > In Asp.Net v1.1 web form I have a number of controls which have the
    > autopostback enabled. Is it possible after the autopostback has run
    > that the control that caused the autopostback to get the focus?
    >
    >
     
    =?Utf-8?B?QmVudCBLcmlzdGlhbnNlbg==?=, Jun 21, 2006
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mad Scientist Jr
    Replies:
    2
    Views:
    5,491
    Mad Scientist Jr
    Jun 29, 2004
  2. - Steve -

    AutoPostBack on TextBox loses Focus

    - Steve -, Jun 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,724
    - Steve -
    Jun 29, 2004
  3. okaminer
    Replies:
    4
    Views:
    2,882
    okaminer
    Feb 15, 2005
  4. Jason
    Replies:
    4
    Views:
    1,921
    Jason
    May 7, 2007
  5. Mufasa
    Replies:
    1
    Views:
    484
    Elroyskimms
    Oct 5, 2007
  6. Pai

    AutoPostBack and Focus...

    Pai, Nov 12, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    231
    susie
    Nov 14, 2003
  7. Asp.Net AutoPostback and control focus

    , Jun 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    204
    Nathan Sokalski
    Jun 23, 2006
  8. Roger
    Replies:
    3
    Views:
    594
Loading...