asp.netvisual-studio-2008html-frames

How do I embed an ASP.NET Web Site (or Web Application) into another?


I have very little experience with ASP.NET and I am doing some self-training before I start writing my first web site/application, which will be a calibration utility. How that utility works is not my concern right now. However, the utility eventually needs to end up embedded in someone else's web site, either just as a URL to the page with my code, or embedded (say, as an HTML frame or an iframe). To figure out the basics of this, I coded up two very simple ASP.NET web sites, a "parent" which contains the frameset, and a "child" which I am trying to put into one of the frames.

The parent's "Default.aspx" HTML code is basically this:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Parent Site Test 1</title>
</head>

<frameset cols="300,*">
    <frame name="outer" src="parent.aspx" noresize></frame>
    <frame name="inner" src="[what do I put here?]"</frame>
</frameset>

</html>

The "parent.aspx" page has only the most basic HTML in it:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        I am the parent web form.
    </div>
    </form>
</body>
</html>

The child web site (as I have it now) lives in a separate VS2008 solution, for the purposes of this exercise, because I am trying to reproduce the conditions in which someone else's web site has to reference my calibration web page/site/thing. I was originally thinking there would be some way to package the entire child into a single DLL, and then there would be some way to tell the parent to use that DLL as the source for the child frame. This comes from my experience in the Java world - using JBoss and J2EE, this would be easily solved because the child would just be deployed as another EAR file.

Being completely inexperienced with VS2008 and ASP.NET, I spent quite a few hours on Google over the past few days trying to find an answer, to no avail.

Thanks for the help! The more specific you can be, the better. I am very new to ASP.NET and Visual Studio, though I do have plenty of experience programming in other languages and IDEs.


Solution

  • If you know the client also uses ASP.Net, you could build it as a User Control.