Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
RAVAILLE James
Bonjour,
Si on a dans la page web : <HTML> <HEAD> <title>WebForm1</title> </HEAD> <body runat="server" id="body"> <!-- ligne importante --> ... </body> </HTML>
Dans la classe code-behind : HtmlGenericControl oHtmlGenericControl; oHtmlGenericControl = (HtmlGenericControl)Page.FindControl("body"); oHtmlGenericControl.Attributes.Add("onload", "init()");
Et voilà ...
Cordialement,
-- James RAVAILLE. MCAD .NET et MCT .NET http://www.certifdotnet.com
"Pierre" a écrit :
Bonjour,
Sur une page entièrement générée à partir du code behind, je souhaiterais ajouter l'attribut "onload" à l'élément <body> de la page.
Comment peut-on faire ?
Merci.
Pierre.
Bonjour,
Si on a dans la page web :
<HTML>
<HEAD>
<title>WebForm1</title>
</HEAD>
<body runat="server" id="body"> <!-- ligne importante -->
...
</body>
</HTML>
Dans la classe code-behind :
HtmlGenericControl oHtmlGenericControl;
oHtmlGenericControl = (HtmlGenericControl)Page.FindControl("body");
oHtmlGenericControl.Attributes.Add("onload", "init()");
Et voilà ...
Cordialement,
--
James RAVAILLE.
MCAD .NET et MCT .NET
http://www.certifdotnet.com
"Pierre" a écrit :
Bonjour,
Sur une page entièrement générée à partir du code behind, je souhaiterais
ajouter l'attribut "onload" à l'élément <body> de la page.
Si on a dans la page web : <HTML> <HEAD> <title>WebForm1</title> </HEAD> <body runat="server" id="body"> <!-- ligne importante --> ... </body> </HTML>
Dans la classe code-behind : HtmlGenericControl oHtmlGenericControl; oHtmlGenericControl = (HtmlGenericControl)Page.FindControl("body"); oHtmlGenericControl.Attributes.Add("onload", "init()");
Et voilà ...
Cordialement,
-- James RAVAILLE. MCAD .NET et MCT .NET http://www.certifdotnet.com
"Pierre" a écrit :
Bonjour,
Sur une page entièrement générée à partir du code behind, je souhaiterais ajouter l'attribut "onload" à l'élément <body> de la page.