Default.aspx
Fonction javascript aide à obtenir l'élément par ID à partir d'un src d'un cadre?
<html>
<frameset id="MainFrameset" rows="78,*" border="0" framespacing="0" frameborder="0">
<frame application="yes" name="menuFrame" src="<% = GetMenuFrameSrcUrl() %>" scrolling="no" noresize>
</frameset>
</html>
Default.aspx.cs
public string GetMenuFrameSrcUrl()
{
return "http://localhost/Application1/Pages/MenuPage.aspx"
}
MenuPage.aspx
<%@ Register TagPrefix="customControl" TagName="Menu" Src="/Controls/Menu.ascx" %>
<html>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0">
<form id="Form1" method="post" runat="server">
<customControl:menu id="Menu1" runat="server">
</customControl:menu>
</form>
</body>
</html>
AnotherPage.aspx
<head id="Head1" runat="server">
<script type="text/javascript">
function testFunction(args, name) {
//Need help here...How can I get the reference of Menu1 id?
//I can get this:
alert(top.frames[0].name); //menuFrame
//But don't know how I can take it further to get some Element ID from the MenuPage.aspx which is the source of this Frame???
}
</script>
</head>
Question: Comment puis-je obtenir la référence de l'ID Menu1 depuis testFunction?
Merci,
Voodoo
L'hypothèse que cette fonction est en défaut .aspx n'est pas correct. La fonction doit être dans une autre page, en particulier 'AnotherPage.aspx' – VoodooChild