SMARTNAVIGATION in asp.net is for "persisting the scroll position when moving
from page to page." and "persisting element focus between navigations."
but , if you google, you will find lot of reports/questions abt smart
navigation not working on browsers other than IE (and some cases in IE too!)
...
SMARTNAVIGATION is the simplest way, but this feature may be limited to
latest IE users.
http://search.microsoft.com/search/r...Navigation&s=1
it is also possible with a simple function .. have a function like below
/// <param name="ControlClientId">pass the Control.ClientID of the server
control you need focus on</param>
private void SetFocus(string ControlClientId)
{
System.Text.StringBuilder strJScript = new System.Text.StringBuilder();
strJScript.Append("<SCRIPT>");
strJScript.Append("document.forms[0].");
strJScript.Append(ControlClientId);
strJScript.Append(".focus();");
strJScript.Append("</SCRIPT>");
Page.RegisterStartupScript("focus",strJScript.ToSt ring());
}
from each post back event, say inside a ddl_chnage event make a call like
below..
SetFocus(ddl.ClientID);
you can build a more Sophisticated solution by setting a hidden control with
the name of last changed HTML control (using onchange javascript event) and
call this same function to set focus on that..
"walterd" wrote:
Hello
I have several controls in the center and bottom of the page that have to
perform some server side events. Is there a way that I can force the browser
to remember the location of the last control, i.e. if I click on a
dropdownlist that fires an event, for the browser to return to the same
control after postback?