Saturday, March 24, 2012

Set focus to a label control

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.
"Sharon" wrote:

> Hi all,
> How can i set focus to a label control.
> lc.Focus() doesn't work.
> Thanks,
> Sharon.
>
>
How can i scroll the page to the label control,
so it is visible?
"clickon" <clickon@.discussions.microsoft.com> wrote in message
news:90DB334E-9BB2-4B3C-80E8-D58565BC9993@.microsoft.com...
> 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.
> "Sharon" wrote:
>
What do you mean by scroll to labe control'
Patrick
"Sharon" <null@.void.nothing> wrote in message
news:e3zWsWxUGHA.5660@.TK2MSFTNGP12.phx.gbl...
> How can i scroll the page to the label control,
> so it is visible?
> "clickon" <clickon@.discussions.microsoft.com> wrote in message
> news:90DB334E-9BB2-4B3C-80E8-D58565BC9993@.microsoft.com...
>
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
"Nenefta" wrote:

> hi Sharon,
> maybe you need to create an anchor where you can link to on your
> webpage?
> Grtx,
> Marcel
>

0 comments:

Post a Comment