开发者

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 %>");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜