views:

70

answers:

2

This sounds like a "why would you do that?" sort of question, but here goes..

I have a very simple ASP.NET page which simply renders out a one column grid of about 10 rows with paging.

At the moment, I need (due to some technical restrictions) to essentially host the ASP.NET page within an IFRAME on a basic HTML page. It works of course, although I wonder if there is a better way?

For some reason I am thinking something like silverlight (which I might end up using) being a container.. or some other ActiveX type control..

Hope this explains enough?

Thanks in advance!

+1  A: 

You might be able to use XmlHttpRequest to fetch the contents on ASP.NET page to an HTML element.

Mehrdad Afshari
thanks for your reply!
+1  A: 

You're right, this is pretty much a "why would you do that" type of thing. However, we all know that you don't always have control over what you would like to do thanks to managers who don't know jack about developing websites, etc :) as I've been in a similar position and been forced to do almost exactly the same thing.

Anyways, I believe the way you are doing it is about the simplest way to do it. The only thing you might want to keep an eye on (I don't know if you are running from separate domains, as the question doesn't specify) is cross-domain scripting. For example, if your ASP.NET page is at www.myaspdomain.com and your HTML page is at www.myhtmldomain.com, cross-domain scripting, or scripting between the IFRAME and the ASP.NET page can cause some interesting bugs (features?) because of the security holes that such scripting opens up and has thus mostly been blocked nowadays.

hmcclungiii
Thanks for that.. yes I was a little concerned about using an iFrame full stop.. not knowing if they are going to be around or not in the future.It's almost like (dare I say it) I need some sort of ActiveX control to host ASP.NET.. strange.. or silverlight.. but thanks for the reply!
Yes, I've done some think like this, but with SharePoint instead.. cross-domain scripting is not your friend.
DrG
no, it is not your friend :)
hmcclungiii