Focus in Web Control?

  • Thread starter Thread starter Dexter
  • Start date Start date
D

Dexter

Hello All,
I have a web control that when receive the focus, a postback is called,
using getPostBackEventReference. But, when the PostBack is called, i want
that the focus goes to the web control.

Somebody know how to make this?


Dexter
 
Hi,
You can retain focus during postbacks by setting SmartNavigation = True for
that page but SmartNavigation has some disadvantages.

"But if i understand you correctly you are trying to cause postback on focus
of a control and if you set focus to the same control will it not cause the
page to postback again" -- forgive me if i got you wrong :)

HTH
srini
 
I tink you need use a javascript on bottom of html.
Try this:
RegisterStartupScript("whatyouwantstring","<SCRIPT
language=javascript>document.getElementById('controlname').focus;</SCRIPT>");
 
Back
Top