Repost: How to determine ID of object in custom web control
- From: Jeffrey Fra*** <jeffreyfra***@xxxxxxxxx>
- Date: Tue, 21 Mar 2006 11:10:00 -0400
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"?
.
- Follow-Ups:
- Re: Repost: How to determine ID of object in custom web control
- From: Anthony Merante
- Re: Repost: How to determine ID of object in custom web control
- Prev by Date: Re: How to determine ID of object in custom web control
- Next by Date: Re: Getting the true URL from an .asp site
- Previous by thread: bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid.
- Next by thread: Re: Repost: How to determine ID of object in custom web control
- Index(es):