ASP Page becoming truncated when converting to IHTMLDocument2 using .innerHTML

114 views Asked by At

I'm reading in an .ASP page from a server. The problem I am having is that the page is becoming truncated when I attempted to read the data in by means of the C# code below.

Below is my code accessing the .asp page

    var htmlDocument  = EmbeddedBrowser.Document as IHTMLDocument2;

    var htmlInnerContent = (((HTMLDocument)(htmlDocument)).documentElement).innerHTML;

Below is the .asp page as it sits on my server

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><script type="text/javascript">Lots of Java Script Here</script><script type="text/javascript">Lots more Java Script Here</script>
</head>
<body>
   <input type="" name="ExpectedClientVersion" value="20.15.09"/>
</body>
</html>

Below is the content of htmlInnerContent after I read it in

<head>
<script type="text/javascript">Lots of Java Script Here</script
</head>

As you can see I am missing the body which is really what I need so I can parse the ExpectedClientVersion.

I have run a fiddler trace and I can see the entire document being passed over.

I also tried researching limitations of .InnerHTML but found only lacking documentation. There may be something to this.

I feel the way I am accessing the document may be incorrect. Does anyone have insight into this?

0

There are 0 answers