Monday, February 8, 2010

ASP .NET - How do I access the HTML content within an IFrame control?

In other words, the raw HTML as if I'd clicked View -%26gt; Source from the browser?ASP .NET - How do I access the HTML content within an IFrame control?
You can't unless the contents of the IFrame are on your own web server. If the contents are coming from another site, then there is no way to see the content.





The best you could do is to check the URL/SRC property of the iframe using javascript and pass it to your ASPX page and then make a server-side HTTP request to that same URL in an attempt to see what the content was.ASP .NET - How do I access the HTML content within an IFrame control?
Look for an iframe src = in the main page, this should give you the link to the page in the frame and then put that in your browsers address bar, when it loads do a View-%26gt;Source.

No comments:

Post a Comment