Sunday, March 11, 2012

Getting the id of TargetControlID in javascript

What targetControlId?

What does the js do?

Can you please be a bit more specific?

Kind regards,
Wim


Hi,

Based on my understanding, you want to get the client side id of the target control with javascript.

Here is how:

function pageLoad() {
var ext = $find("behaviorID of the extender");
var ele = ext.get_element();
var id = ele.id;
}


Raymond Wen - MSFT:

Hi,

Based on my understanding, you want to get the client side id of the target control with javascript.

Here is how:

function pageLoad() {
var ext = $find("behaviorID of the extender");
var ele = ext.get_element();
var id = ele.id;
}

Thanks that got the id fine. Realised I needed the UniqueID though which I don't think is possible with javascript so I ended up passing the UniqueID of the TargetControlID to the javascript from the Extender's class file.


DavidRhodes:

Realised I needed the UniqueID though

Try this:

$find('<%=ExtendersIDYouNeedToFillIn.ClientID%>');

Kind regards,
Wim

No comments:

Post a Comment