have you tried using templates? separate the HTML part from ASP stuff and call the javascript from the HTML part. this is if you only want to manipulate the HTML part using the jscript function.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.