hrabia Posted May 31, 2003 Posted May 31, 2003 I have one contol ctlLoader which loads second control ucComment. The second control has one textbox txtNewComment. I'd like to set focus on my textbox. I've look at rendered code and find out that my controls id is ctlLoader__ctl0_ucComment_txtNewComment so I can set focus like this (client-side javascript): document.frmDefault.ctlLoader__ctl0_ucComment_txtNewComment.focus(); But how can I get this id programatically? Quote A man and a dog have an average of three legs. Beaware of Statistics.
wyrd Posted May 31, 2003 Posted May 31, 2003 *scratches head* If all you want to do is set the focus to a control then why would you need the ID? Can't you just do a simple txtNewComment.Focus() ? Quote Gamer extraordinaire. Programmer wannabe.
hrabia Posted May 31, 2003 Author Posted May 31, 2003 The focus was only example. I'd like to do a little bit more on a client :) Quote A man and a dog have an average of three legs. Beaware of Statistics.
*Gurus* Derek Stone Posted May 31, 2003 *Gurus* Posted May 31, 2003 The client-side ID for a specific control is stored in the Control.ClientID property. This ID can be used with the W3C DOM and JavaScript, which is what you're looking for. Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.