Control IDs reverse?

J

JW

I have a WebControl, lets call it WebC. WebC has a Label control, with
an ID of TheLabel. I have a UserControl, lets call it UserC. I drop
WebC onto UserC; WebC has an ID of "WebC1" and the Label on WebC1 now
has an ID of "WebC1_TheLabel". I drop UserC onto a page; UserC has an
ID of "UserC1" and the Label on WebC1 now has an ID of
"UserC1_WebC1_MyLabel". From within the WebC code, there is an area
that writes the Label control's ID [e.g. this.Attributes.Add(
"onmouseover", "jsfunction('" + this._theLabel.ID + "');"]. Okay, so
when the control renders the onmouseover event SHOULD look something
like this:

onmouseover="jsfunction('UserC1_WebC1_MyLabel');"

But instead it comes out like this:

onmouseover="jsfunction('WebC1_UserC1_MyLabel');"

It reverses WebC1 with UserC1 in the naming container. Why does this
happen and how do you correct it?

-James
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top