How to determine ID of object in custom web control

  • Thread starter Thread starter jef
  • Start date Start date
J

jef

I've got a rather simple custom web control that has an object declared
as HtmlControls.HtmlInputHidden
 
My post appears to have gotten truncated... Google Groups doesn't
appear to work well with Safari.. here was the original post:

I've got a rather simple custom web control that has an object declared
as HtmlControls.HtmlInputHidden\0. 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 referencing the object in javascript as
document.all['WebCtl3_PageNo']\0 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... is there a way to iterate through
document.all and look for "*PageNo"?
 

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