Set Focus to Field in User Control
I have a web user control containing a postback enabled checkbox called chkBold. When this check box is clicked, postback occurs and focus on the check box is lost. I want to put focus back on the check box after the form refreshes but this code, contained in the code behind for the check box, isn't working:
RegisterStartUpScript("SetFocus", "<script>document.frmSurveyDefn.TitleStyle.chkBold .focus();</script>")
What is the proper format when referencing an object in a user control?
|