Set focus to a label control

  • Thread starter Thread starter Sharon
  • Start date Start date
S

Sharon

Hi all,
How can i set focus to a label control.
lc.Focus() doesn't work.
Thanks,
Sharon.
 
You can't, setting focus to a label control doesn't make sense as it just
renders as text in the browser so there is no form field upon which to set
the focus.
 
hi Sharon,

maybe you need to create an anchor where you can link to on your
webpage?

Grtx,
Marcel
 
Exactly like Nenfta said
<a name="focusmylabel"><asp:label id="mylabel"></a>

in javascript function
window.location.href ="default.aspx#focusmylabel";

Hope this helps.
DWS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top