Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Set Focus to control after postback

Reply
Thread Tools

Set Focus to control after postback

 
 
=?Utf-8?B?VmljdG9yaW91czE=?=
Guest
Posts: n/a
 
      10-29-2007
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>
 
Reply With Quote
 
 
 
 
SE.Computerguy
Guest
Posts: n/a
 
      10-29-2007
On Oct 29, 1:08 pm, Victorious1
<Victorio...@discussions.microsoft.com> wrote:
> 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());

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set Focus after Postback (vb.net newbie) Mel ASP .Net 8 04-17-2008 04:25 PM
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
Why does putting focus on textbox also set focus to submit jw56578@gmail.com Javascript 2 06-06-2005 08:20 PM
unable to set focus to control after validation (must tab twice to exit control) Mad Scientist Jr ASP .Net Web Controls 0 07-13-2004 08:01 PM
Re: How can I set focus on a control after a post-back? ashelley@inlandkwpp.com ASP .Net 5 06-27-2004 03:50 AM



Advertisments