Hi Roby,
As for this problem, I think we can consider different approachs according
to different scenairo:
1. If we want to display another page inside an existing page and the inner
page need to interact with the user, I think use a IFRAME element (or
frame) is suitable(seems also the only means).
2. As you mentioned that the ASP page use some report component, is it
displaying some graphic report and need to be print together with the
container page?
If so ,I think it's better to contain's the ASP page's output html as part
of the container ASP.NET page's output. In .net framework , the
HttpWebRequest class can help us to programly request a certain web
resource and retrieve back the response stream. Thus, we can use it to
manually request the ASP page in ASP.NET page's code behind and embeded the
ASP page's response html into the ASP.NET page's output ( for example , in
a <div> ..</div> ). And following is a simple sample on this:
============container aspx page==========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>outer</title>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table width="100%">
<tr>
<td>
<asp:Label id="lblTitle" runat="server">Below is the embeded ASP
Report</asp:Label>
</td>
</tr>
<tr>
<td>
<div id="divInner" runat="server"></div>
</td>
</tr>
</table>
</form>
</body>
</HTML>
============aspx page codebehind===============
public class outer : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlGenericControl divInner;
protected System.Web.UI.WebControls.Label lblTitle;
private void Page_Load(object sender, System.EventArgs e)
{
try
{
string url = Request.Url.ToString();
url = url.Substring(0,url.LastIndexOf("/")+1) + "inner.asp";
divInner.InnerHtml = GetPageOutput(url);
}
catch(Exception ex)
{
Response.Write("<br>" + ex.Message);
}
}
private string GetPageOutput(string url)
{
WebRequest wr = WebRequest.Create(url);
StreamReader sr = new StreamReader(wr.GetResponse().GetResponseStream());
return sr.ReadToEnd();
}
..................................
}
=============inner asp page =================
<table width="100%" align="center" border="1">
<%
for i = 1 to 5
%>
<tr>
<td>Report Item: <%= i %></td>
</tr>
<%
Next
%>
</table>
========================================
Hope helps. Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)