How to determine ID of object in custom web control

J

jef

I've got a rather simple custom web control that has an object declared
as HtmlControls.HtmlInputHidden
 
J

Jeffrey Frabutt

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

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top