This project has moved and is read-only. For the latest updates, please go here.

How do I add script Body's on Load with Html Agility Pack

Topics: Developer Forum
Apr 20, 2011 at 9:39 AM

How do I add script Body's on Load using Html Agility Pack like below example.


before html.:

<body class="..." onLoad="...;">    .....</body>

after add:
<body class="..." onLoad="...;added script;">    .....</body>
Apr 21, 2011 at 10:53 PM

Try this:

var htmlDoc = new HtmlDocument();

var body = htmlDoc.DocumentNode.SelectSingleNode("//body");
body.Attributes["onLoad"].Value += "added script;";