471,088 Members | 1,265 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,088 software developers and data experts.

Controls Lose Focus When You Enable SmartNavigation and AutoPostBack

I get the following from the link http://support.microsoft.com/kb/314206. I need to have both work - the page stays where it is and set focus to next control. Does anyone have solution? I have been working on this for days. I am using ASP.NET 2003. Thanks.


PRB: Controls Lose Focus When You Enable SmartNavigation and AutoPostBack
View products that this article applies to.
Article ID : 314206
Last Review : February 23, 2007
Revision : 4.1
This article was previously published under Q314206
On This Page





Steps to Reproduce the Behavior

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

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

This behavior is by design.
Back to the top

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" >
<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">
<form id="Form1" method="post" runat="server">
<asp:TextBox AutoPostBack=True id=TextBox1 runat="server" />
<asp:TextBox AutoPostBack=True id=TextBox2 runat="server" />

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).
Mar 12 '07 #1
1 1934
read the following article

Sep 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by SLE | last post: by
2 posts views Thread by Elsa Luiz | last post: by
3 posts views Thread by Dexter | last post: by
5 posts views Thread by Finn Stampe Mikkelsen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.