Microsoft KB Archive/314206

= PRB: Controls Lose Focus When You Enable SmartNavigation and AutoPostBack =

Article ID: 314206

Article Last Modified on 5/11/2007

-

APPLIES TO


 * Microsoft ASP.NET 1.1
 * Microsoft ASP.NET 1.0

-



This article was previously published under Q314206



SYMPTOMS
When you use the TAB key to move through Web Form controls, when you enable both SmartNavigation and AutoPostBack, the control that receives focus loses focus after the control posts back.



CAUSE
This problem occurs because of how SmartNavigation is implemented to track the current state and active element between round trips to the server.



STATUS
This behavior is by design.



Steps to Reproduce the Behavior
  Create a new ASP.NET page with the following code: <%@ Page SmartNavigation=&quot;true&quot; language=&quot;c#&quot; AutoEventWireup=&quot;false&quot; %> <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; >          <asp:TextBox AutoPostBack=True id=TextBox2 runat=&quot;server&quot; /> </HTML> </li> <li>Run the page.</li> <li>Type some text in TextBox1, and then press the TAB key to move to the next control. Notice that the focus is temporarily set on TextBox2, but then the focus is lost and set back to the initial control (TextBox1).</li></ol>

<div class="references_section">