dnn_ctr381_Que2_Dock_MyTasks.
I get around that by calling a Javascript function that returns a control containing the name Dock_MyTasks. But, when I look at the running HTML, there are multiple HTML elements that contain the name Dock_MyTasks. They are suffixed with _T, _C, _ClientState. Here's the JavaScript I'm trying to use. Everyhing seems to execute just fine until I call the GetClientId function. What am I doing wrong?
function miClicked(sender, e) {
var MenuItem = e.get_item();
var DockName = MenuItem.get_value();
var dock = GetClientId(DockName);
var isClosed = dock.get_closed();
dock.set_closed(!isClosed);
MenuItem.Selected = !MenuItem.Selected;
}
// Gets the ASP.NET generated control ID
function GetClientId(controlId) {
var count = document.forms[0].length;
var i = 0;
var aspControlId;
for (i = 0; i < count; i++) {
aspControlId = document.forms[0].elements[i].id;
pos = aspControlId.indexOf(controlId);
if (pos >= 0) break;
}
return document.forms[0].elements[i];
}