I have a web page that uses ASP.NET AJAX controls. I have a simple piece of code that sets the focus to a control. I put it in the Page_PreRender() event handler. It works great when the page loads. However, when the partial page update caused by the UpdatePanel occurs, the focus isn't set. I have another piece of code that sets the text of a textbox field to DateTime.Now.ToString() and that works just fine. The server is reading the Page.SetFocus(CheckBox1) line of code, it's just not doing it. It's very conistent. It works EVERY time if I do a page refresh by pressing F5 but NEVER when I do a partial page postback. Is this a bug? Is there a workaround? I'm pulling my hair out here! Any help would be appreciated.
Start Free Trial