Focus in Web Control?

Discussion in 'ASP .Net' started by Dexter, Oct 18, 2004.

  1. Dexter

    Dexter Guest

    Hello All,
    I have a web control that when receive the focus, a postback is called,
    using getPostBackEventReference. But, when the PostBack is called, i want
    that the focus goes to the web control.

    Somebody know how to make this?


    Dexter
     
    Dexter, Oct 18, 2004
    #1
    1. Advertisements

  2. Dexter

    Dexter Guest

    thanks


    Dexter
     
    Dexter, Oct 18, 2004
    #2
    1. Advertisements

  3. Dexter

    Guest Guest

    Hi,
    You can retain focus during postbacks by setting SmartNavigation = True for
    that page but SmartNavigation has some disadvantages.

    "But if i understand you correctly you are trying to cause postback on focus
    of a control and if you set focus to the same control will it not cause the
    page to postback again" -- forgive me if i got you wrong :)

    HTH
    srini
     
    Guest, Oct 18, 2004
    #3
  4. Dexter

    Cirrosi Guest

    I tink you need use a javascript on bottom of html.
    Try this:
    RegisterStartupScript("whatyouwantstring","<SCRIPT
    language=javascript>document.getElementById('controlname').focus;</SCRIPT>");
     
    Cirrosi, Oct 18, 2004
    #4
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.