Repost: How to determine ID of object in custom web control



Sorry about the repost... but my original post had funky characters that was causing it to get truncated.

I've got a rather simple custom web control that has an object delcared as HtmlControls.HtmlInputHidden. I set the ID = 'PageNo' and the Name = 'PageNo'. However, when I look at the page source in the browser, the object's ID is "WebCtl3_PageNo" and the Name is "WebCtl3:PageNo". I'm reference the object in javascript as document.all['WebCtl3_PageNo'] but that seems lame. I get the feeling that the ID will somehow magically change to "WebCtl2_PageNo" or "WebCtl4_PageNo" without me realizing it. Is there a better way? I need to reference it in javascript on the client side. Is there a way to iterate through document.all and looke for "*PageNo"?

.