Problème iframe onload + javascript
Bonjour,
Dans ma page aspx, je souhaite ajouter un IFrame avec une méthode sur l'évènement onLoad.
Code:
1 2
|
<iframe src="http:www.google.fr" id="aa" runat="server" height="785" width="503" onload="javascript:alert(this.contentWindow.location);" /> |
J'obtiens l'erreur suivante :
Citation:
An error occurred during the compilation of the requested file, or one of its dependencies. ) attendue
Dans le fichier de logs :
Citation:
System.Web.HttpCompileException: c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\sporteef.website\PageAutentification.aspx(19): error CS1026: ) attendue à System.Web.Compilation.AssemblyBuilder.Compile() à System.Web.Compilation.BuildProvidersCompiler.PerformBuild() à System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) à System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) à System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) à System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) à System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) à System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) à System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() à System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 91264770-c791-45e5-a369-16a4cd77e86b
Sans le "onload", mon iframe fonctionne. Mais est-ce que l'évènement onload est appelé à chaque fois que je change de page dans mon iframe? Car en utilisant le onload en code behind, j'ai l'impression que l'évènement n'est détecté que la toute première fois que l'on charge la page.