Advertisement

02.22.2007 at 06:08PM PST, ID: 22408222
[x]
Attachment Details

Page.SetFocus() doesn't work on partial page postback

Asked by Russ_Suter in .NET Framework 2.0, C# Programming Language, Programming for ASP.NET

Tags: updatepanel, work

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
[+][-]02.23.2007 at 03:19AM PST, ID: 18594967

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.23.2007 at 10:22AM PST, ID: 18598040

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.23.2007 at 10:28AM PST, ID: 18598084

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 2.0, C# Programming Language, Programming for ASP.NET
Tags: updatepanel, work
Sign Up Now!
Solution Provided By: Banzai10
Participating Experts: 1
Solution Grade: C
 
 
[+][-]02.23.2007 at 11:14AM PST, ID: 18598460

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.23.2007 at 11:47AM PST, ID: 18598713

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.23.2007 at 03:36PM PST, ID: 18600168

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32