Saturday, March 24, 2012

Set Focus to control after postback

I am usingVB with .net 1.1 and I wish to set focus to a textbox after the
autopostback event of a dropdownlist. When the user changes the selection of
my dropdownlist an onchange event occurs and the form does autopostback.
After the on change event I need to set focus to the next textbox. How do I
do this>On Oct 29, 1:08 pm, Victorious1
<Victorio...@.discussions.microsoft.comwrote:

Quote:

Originally Posted by

I am usingVB with .net 1.1 and I wish to set focus to a textbox after the
autopostback event of a dropdownlist. When the user changes the selection of
my dropdownlist an onchange event occurs and the form does autopostback.
After the on change event I need to set focus to the next textbox. How do I
do this>


This is C# syntax but the idea is the same for VB.

In the page load method have this:
Page.ClientScript.RegisterClientScriptBlock(this.G etType(),
"SomeName", <WebControlName>.focus());

0 comments:

Post a Comment