Actually, that's exactly what I was using -
document.getElementById(ClientID).focus()
The solution is really simple. Instead of ClientID I have to use UniqueID.
--
Sergio Florez M.
Medellín, Colombia
[quoted text, click to view] <lisa@starways.net> wrote in message
news:1119281080.663361.21240@g49g2000cwa.googlegroups.com...
You don't, really. The ID will be NamingContainerID_ChildID, and the
name will be NamingContainerID:ChildID. That's just the way it works.
If you're using Javascript, you could do
document.getElementById(ClientID).focus()
Otherwise, you're going to have to override Render and manually set the
name equal to the id. That's a pain, and unnecessary.
Lisa
[quoted text, click to view] Sergio FLorez M. wrote:
> I created a composite control which works just fine. I want to be able to
> set the focus to one of its contained controls (a textbox) but this is
> giving me a javascript error. The problem is that the ClientID property of
> the contained textbox is not giving me the correct value. When I debug the
> application the contained textbox's ClientID is "myControl__ctl1", but
when
> I look at the generated HTML the input tag looks like this: <input
> name="myControl:_ctl1" ... />
>
> How did the first "_" turn into ":" and how do I fix this?
>
> --
> Sergio Florez M.
> Medellín, Colombia