When does Control Id get changed ?
In CreateChildControls I create a table and give each row an id based on the
record number from a db i.e.
trTwo.ID = "tq" & myRecordSet("QuestionId").ToString
However when it is rendered on the page when the custom control is in a
master page scenario the id is ctl_whatever_someotherjunk_tq1
When is the id changed from what I designed it to be (and if you can tell me
Re: When does Control Id get changed ?
> When is the id changed from what I designed it to be (and if you can tell
> me why)
ASP.NET maintains the IDs so that every control has unique id (on server and
on client) within a naming scope (naming container). What you see is the id
for client (given by ClientID server-side property of your control), so that
The complete unique ID consists of IDs of your control's parent controls
which are naming containers plus your control's "local" ID. Naming container
means a control which specifies a naming scope such that all control IDs
within its scope are unique. For example DataGrid/GridView row is such.
Your control does have the ID you specify to it (ther "local" one), but its
the ID which is unique on the current naming scope (within parent of your
ASP.NET MVP, AspInsider
|All times are GMT. The time now is 11:26 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.