Setting focus on RadioButtonList after postback

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?VGhlRHJpZnRlcg==?=

    Setting focus on RadioButtonList after postback

    This seems to be one of the great mysteries of ASP.NET as I have seen
    numerous postings on this with absolutely no answers. SetFocus does not work
    on the RadioButtonList control. Does anybody know the proper way to set the
    focus on a RBL after a postback so the user at least knows where they are on
    the screen? This cannot be so difficult?
  • Gaurav Vaish \(a.k.a. MasterGaurav\)

    #2
    Re: Setting focus on RadioButtonList after postback

    This seems to be one of the great mysteries of ASP.NET as I have seen
    numerous postings on this with absolutely no answers. SetFocus does not
    work
    on the RadioButtonList control. Does anybody know the proper way to set
    the
    Because RadioButtonList has no parallelism in HTML.
    It's only the individual items in RadioButtonList - RadioButton - that
    figures in HTML and can be focussed.

    What you can do is something as follows:

    ListItem selectedItem = radioButtonList .SelectedItem;
    selectedItem.At tributes.Add("o nload", "this.focus();" );


    HTH


    --
    Happy Hacking,
    Gaurav Vaish | http://dwt.sourceforge.net
    http://blogs.mastergaurav.com | http://eduzine.edujini-labs.com
    --------------------------------




    Comment

    Working...