Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: Controls Lose Focus When You Enable SmartNavigation and AutoPostBack


View products that this article applies to.

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.

↑ Back to the top


Cause

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

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


More information

Steps to Reproduce the Behavior

  1. Create a new ASP.NET page with the following code:
    <%@ Page SmartNavigation="true" language="c#" AutoEventWireup="false" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
      <HEAD>
        <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name=vs_defaultClientScript content="JavaScript (ECMAScript)">
        <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
      </HEAD>
      <body>
        <form id="Form1" method="post" runat="server">
    		<asp:TextBox AutoPostBack=True id=TextBox1 runat="server" />
    		<asp:TextBox AutoPostBack=True id=TextBox2 runat="server" />
        </form>
      </body>
    </HTML>
    					
  2. Run the page.
  3. 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).

↑ Back to the top


References

For information about the latest SmartNavigation updates and related information, visit the following Microsoft Web sites:
ASP.NET Hot Fixes Forum
http://forums.asp.net/

Page.SmartNavigation Property (from the Microsoft .NET Framework Class Library)
http://msdn2.microsoft.com/en-us/library/system.web.ui.page.smartnavigation(vs.71).aspx
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
318320 Error Message When You Submit .aspx Page with SmartNav Under SSL

↑ Back to the top


Keywords: KB314206, kbwebforms, kbservercontrols, kbprb

↑ Back to the top

Article Info
Article ID : 314206
Revision : 9
Created on : 5/11/2007
Published on : 5/11/2007
Exists online : False
Views : 666