In asp.net refernce a parent page's control from javascript
I had a DropDownList on the page that I reference in JavaScript like this:
var ProjectsDropDownList = '<%= ProjectsDropDownList.ClientID %>';
However, I had to move the DropDownList up to the parent IFr开发者_如何学JAVAame.
How do I reference that control that is now in the parent IFrame from the child IFrame in JavaScript?
If your control still has the same id
after you move it to the parent frame, you can do:
var movedElement = window.parent.document.getElementById(
"<%= ProjectsDropDownList.ClientID %>");
精彩评论