473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Embed ASP page in ASP.NET

I am trying to figure out if it is possible to embed an ASP page in an
ASP.NET page. Our company uses a third-party system that creates reports in
classic ASP. I am creating a portal for our customers, using ASP.NET and
would like to seamlessly integrate the third-party's classic ASP page in the
portal.

I realize I can pass hidden form variables to the ASP page and open the ASP
page in a new instance of IE, but I'd like to find a more seamless way.

Thanks,
Roby2222
Nov 18 '05 #1
10 1724
Roby2222 wrote:
I am trying to figure out if it is possible to embed an ASP page in an
ASP.NET page.


I just use frames to do this.

--
Gerry Hickman (London UK)
Nov 18 '05 #2
Hi,

I think use iframe is good idea. set the frameborder=0

--
Juno
MCSD.NET, MCDBA, MCSE
----------------------------------------------------------
Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
DataForm.NET - The most powerful data entry web server control for ASP.NET

"Roby2222" <ro******@community.nospam> wrote in message
news:C7**********************************@microsof t.com...
I am trying to figure out if it is possible to embed an ASP page in an
ASP.NET page. Our company uses a third-party system that creates reports in classic ASP. I am creating a portal for our customers, using ASP.NET and
would like to seamlessly integrate the third-party's classic ASP page in the portal.

I realize I can pass hidden form variables to the ASP page and open the ASP page in a new instance of IE, but I'd like to find a more seamless way.

Thanks,
Roby2222

Nov 18 '05 #3
Thanks for the suggestion, but I'm really not a fan of frames. It seems that
users always get confused when they try to print, but they clicked on a
different frame (such as the menu frame) just before printing.

Does anyone know any other way?

Thanks,
Roby2222

"Juno" wrote:
Hi,

I think use iframe is good idea. set the frameborder=0

--
Juno
MCSD.NET, MCDBA, MCSE
----------------------------------------------------------
Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
DataForm.NET - The most powerful data entry web server control for ASP.NET

"Roby2222" <ro******@community.nospam> wrote in message
news:C7**********************************@microsof t.com...
I am trying to figure out if it is possible to embed an ASP page in an
ASP.NET page. Our company uses a third-party system that creates reports

in
classic ASP. I am creating a portal for our customers, using ASP.NET and
would like to seamlessly integrate the third-party's classic ASP page in

the
portal.

I realize I can pass hidden form variables to the ASP page and open the

ASP
page in a new instance of IE, but I'd like to find a more seamless way.

Thanks,
Roby2222


Nov 18 '05 #4
If frameboder=0 ,users won't see there is a iframe in the page.

--
Juno
MCSD.NET, MCDBA, MCSE
----------------------------------------------------------
Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
DataForm.NET - The most powerful data entry web server control for ASP.NET

"Roby2222" <ro******@community.nospam> wrote in message
news:E7**********************************@microsof t.com...
Thanks for the suggestion, but I'm really not a fan of frames. It seems that users always get confused when they try to print, but they clicked on a
different frame (such as the menu frame) just before printing.

Does anyone know any other way?

Thanks,
Roby2222

"Juno" wrote:
Hi,

I think use iframe is good idea. set the frameborder=0

--
Juno
MCSD.NET, MCDBA, MCSE
----------------------------------------------------------
Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
DataForm.NET - The most powerful data entry web server control for ASP.NET
"Roby2222" <ro******@community.nospam> wrote in message
news:C7**********************************@microsof t.com...
I am trying to figure out if it is possible to embed an ASP page in an
ASP.NET page. Our company uses a third-party system that creates reports
in
classic ASP. I am creating a portal for our customers, using ASP.NET
and would like to seamlessly integrate the third-party's classic ASP page in the
portal.

I realize I can pass hidden form variables to the ASP page and open
the ASP
page in a new instance of IE, but I'd like to find a more seamless

way.
Thanks,
Roby2222


Nov 18 '05 #5
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.)


Nov 18 '05 #6
Hi,

I did not try this, but I guess that if you want to acomplish this the
way you described, you may try using HttpWebRequest/HttpWebResponse
class and then print out the result in your asp.net application.

Still, you should be aware that your server may suffer :)

Sasa .
"Roby2222" <ro******@community.nospam> wrote in message news:<E7**********************************@microso ft.com>...
Thanks for the suggestion, but I'm really not a fan of frames. It seems that
users always get confused when they try to print, but they clicked on a
different frame (such as the menu frame) just before printing.

Does anyone know any other way?

Thanks,
Roby2222

"Juno" wrote:
Hi,

I think use iframe is good idea. set the frameborder=0

--
Juno
MCSD.NET, MCDBA, MCSE
----------------------------------------------------------
Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
DataForm.NET - The most powerful data entry web server control for ASP.NET

"Roby2222" <ro******@community.nospam> wrote in message
news:C7**********************************@microsof t.com...
I am trying to figure out if it is possible to embed an ASP page in an
ASP.NET page. Our company uses a third-party system that creates reports in classic ASP. I am creating a portal for our customers, using ASP.NET and
would like to seamlessly integrate the third-party's classic ASP page in the portal.

I realize I can pass hidden form variables to the ASP page and open the ASP page in a new instance of IE, but I'd like to find a more seamless way.

Thanks,
Roby2222


Nov 18 '05 #7
I just checked the docs and it seems like that System.Net.WebClient is
doing the job (not HttpWebRequest as I said earlier) :)

Sasa .

"Roby2222" <ro******@community.nospam> wrote in message news:<E7**********************************@microso ft.com>...
Thanks for the suggestion, but I'm really not a fan of frames. It seems that
users always get confused when they try to print, but they clicked on a
different frame (such as the menu frame) just before printing.

Does anyone know any other way?

Thanks,
Roby2222

"Juno" wrote:
Hi,

I think use iframe is good idea. set the frameborder=0

--
Juno
MCSD.NET, MCDBA, MCSE
----------------------------------------------------------
Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
DataForm.NET - The most powerful data entry web server control for ASP.NET

"Roby2222" <ro******@community.nospam> wrote in message
news:C7**********************************@microsof t.com...
I am trying to figure out if it is possible to embed an ASP page in an
ASP.NET page. Our company uses a third-party system that creates reports in classic ASP. I am creating a portal for our customers, using ASP.NET and
would like to seamlessly integrate the third-party's classic ASP page in the portal.

I realize I can pass hidden form variables to the ASP page and open the ASP page in a new instance of IE, but I'd like to find a more seamless way.

Thanks,
Roby2222


Nov 18 '05 #8
Thanks for the help everyone. I think I'll give the HttpWebRequest idea a
try. The only thing I'm not sure about is that the ASP page will contain
links and is basically a site on it's own. If I use HttpWebRequest to stream
the first page into the DIV, then what would happen when a user clicks on a
link in the ASP page, which calls another ASP page? I'm guessing the target
ASP page would replace the ASP.NET page with the embeded ASP page, rather
than keep the ASP.NET "container" and just replace the DIV section with the
new page.

Thanks,
Rob

"Sasa ." wrote:
I just checked the docs and it seems like that System.Net.WebClient is
doing the job (not HttpWebRequest as I said earlier) :)

Sasa .

"Roby2222" <ro******@community.nospam> wrote in message news:<E7**********************************@microso ft.com>...
Thanks for the suggestion, but I'm really not a fan of frames. It seems that
users always get confused when they try to print, but they clicked on a
different frame (such as the menu frame) just before printing.

Does anyone know any other way?

Thanks,
Roby2222

"Juno" wrote:
Hi,

I think use iframe is good idea. set the frameborder=0

--
Juno
MCSD.NET, MCDBA, MCSE
----------------------------------------------------------
Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
DataForm.NET - The most powerful data entry web server control for ASP.NET

"Roby2222" <ro******@community.nospam> wrote in message
news:C7**********************************@microsof t.com...
> I am trying to figure out if it is possible to embed an ASP page in an
> ASP.NET page. Our company uses a third-party system that creates reports

in
> classic ASP. I am creating a portal for our customers, using ASP.NET and
> would like to seamlessly integrate the third-party's classic ASP page in

the
> portal.
>
> I realize I can pass hidden form variables to the ASP page and open the

ASP
> page in a new instance of IE, but I'd like to find a more seamless way.
>
> Thanks,
> Roby2222

Nov 18 '05 #9
Roby2222 wrote:
ASP page would replace the ASP.NET page with the embeded ASP page, rather
than keep the ASP.NET "container" and just replace the DIV section with the
new page.


That's why frames are so cool. You can always give them a "print" button
if they're that green.

--
Gerry Hickman (London UK)
Nov 18 '05 #10
Hi Gerry,

yes, since the HttpWebRequest approach embeded the asp page's response HTML
into the asp.net page, so all the hyperlinks will also be treated as the
link in the asp.net page. And in addition to replace the currently page
when we hit the link, since we generally use relative path in hyperlink it
is likely that the links be broken. As for this point, Iframe seems more
reasonable. Anyway, what approach to use depends on your acutal scenairo.

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.)

Nov 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after...
2
by: François de Dardel | last post by:
Please don't scream that EMBED is evil ! What I am doing is <EMBED SRC="BWV659.mid" AUTOSTART="false" LOOP="TRUE" CONTROLS="SMALLCONSOLE" WIDTH="50" HEIGHT="15" TITLE="BWV 659"> Note the...
2
by: Cris Curtis | last post by:
When I use an embed tag that uses a dynamic aspx page, the dynamic aspx page appears to get called 2 times instead. Below is code that adds an embed tag to a placeholder control that will use...
1
by: snicks | last post by:
I have a series of XLS files which I need to embed into a PowerPoint presentation on an IIS server. I’ll be using VB.NET. I’ve tried using an ASPOSE.PowerPoint control to do this and it does...
3
by: Chris Tomlinson | last post by:
Hi all, I hope someone is able to help me out with a small problem with this page: http://www.superhighstreet.com/George-Street-Richmond/index.shtml I have a small iframe (mid-right) with an...
1
by: Andrew Poulos | last post by:
With "normal" SWF HTML there's an EMBED tag nested within an OBJECT tag. How can I check which tag is actually displaying the SWF? I'm using CSS on them and the style on the OBJECT affects the...
2
by: John | last post by:
I have CSS drop down navigatoon bar and it works fine. However, when I have page where I have an <embed - needed to show a PDF file, such as: <embed src="Security.pdf" width="900"...
3
by: =?Utf-8?B?SG93IHRvIGVtYmVkIGEgQnJvd3Nlci4uLi4uLi4u | last post by:
How can i embed a web browser in an IE page?
2
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.