473,385 Members | 1,912 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,385 software developers and data experts.

Displaying ASP page in ASPX page

Is there a way to display/render an ASP page inside of an ASPX page with ASP
..Net 2.0? I'm not trying to back into frames but I have an application that
will allow me to customize complex rendered reports by adding parms to the
query string of an ASP page and just calling the entire URL. This works great
for web parts in SharePoint and with a Windows application, but I'm not sure
how to do it with ASP .Net. In fact, I'm looking for the exact thing that can
be done in SharePoint and that's a web part that takes a URL as an input
parm.

I'm starting to think that this just isn't possible without frames. I know
the best solution would be to not reference the ASP page but suffice to say
that's not an option due to time contraints.

Thanks.
Feb 16 '07 #1
9 1779
MattM,

This is fairly easy in Sharepoint Portal Server 2003/MOSS 2007. You have
something called PageViewerWebPart that will take the url of the page to be
rendered(including query string).

The samething is feasible in ASP.NET 2.0. You need to create Custom Control
that accepts the url as the parameter and renders the page. This is bit
complex in nature.

--
Thanks & Regards,
Mark Nelson
"MattM" wrote:
Is there a way to display/render an ASP page inside of an ASPX page with ASP
.Net 2.0? I'm not trying to back into frames but I have an application that
will allow me to customize complex rendered reports by adding parms to the
query string of an ASP page and just calling the entire URL. This works great
for web parts in SharePoint and with a Windows application, but I'm not sure
how to do it with ASP .Net. In fact, I'm looking for the exact thing that can
be done in SharePoint and that's a web part that takes a URL as an input
parm.

I'm starting to think that this just isn't possible without frames. I know
the best solution would be to not reference the ASP page but suffice to say
that's not an option due to time contraints.

Thanks.
Feb 16 '07 #2
I've seen where it's easy in Sharepoint, but that isn't an option. I need to
use ASP .Net but I'm not sure how to do it in ASP .Net 2.0. Any suggestions
on where to begin? I've looked at a few things (user control, web control,
web part) but I can't see how to make a control that would render an ASP
page. If you think it's possible I could use at least some high level
suggestions.

"Mark Nelson" wrote:
MattM,

This is fairly easy in Sharepoint Portal Server 2003/MOSS 2007. You have
something called PageViewerWebPart that will take the url of the page to be
rendered(including query string).

The samething is feasible in ASP.NET 2.0. You need to create Custom Control
that accepts the url as the parameter and renders the page. This is bit
complex in nature.

--
Thanks & Regards,
Mark Nelson
"MattM" wrote:
Is there a way to display/render an ASP page inside of an ASPX page with ASP
.Net 2.0? I'm not trying to back into frames but I have an application that
will allow me to customize complex rendered reports by adding parms to the
query string of an ASP page and just calling the entire URL. This works great
for web parts in SharePoint and with a Windows application, but I'm not sure
how to do it with ASP .Net. In fact, I'm looking for the exact thing that can
be done in SharePoint and that's a web part that takes a URL as an input
parm.

I'm starting to think that this just isn't possible without frames. I know
the best solution would be to not reference the ASP page but suffice to say
that's not an option due to time contraints.

Thanks.
Feb 16 '07 #3
Yeah - its pretty difficult without frames. Perhaps you should just use an
iFrame or a popup window and load that using javascript with the correct
URL's. Technically, thats all athe sharepoint PageViewerWebPart really
does.

The alternative would be to use the network classes to get the html from a
remote asp call and load that into your page. You'll need to strip out the
head details, and you may have problems with styles - but you can get it to
work depending on how complex your asp page is, its just a bit of work for
the return. Its easy enough to render that into a panel

--
Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"MattM" <Ma***@discussions.microsoft.comwrote in message
news:4E**********************************@microsof t.com...
Is there a way to display/render an ASP page inside of an ASPX page with
ASP
.Net 2.0? I'm not trying to back into frames but I have an application
that
will allow me to customize complex rendered reports by adding parms to the
query string of an ASP page and just calling the entire URL. This works
great
for web parts in SharePoint and with a Windows application, but I'm not
sure
how to do it with ASP .Net. In fact, I'm looking for the exact thing that
can
be done in SharePoint and that's a web part that takes a URL as an input
parm.

I'm starting to think that this just isn't possible without frames. I know
the best solution would be to not reference the ASP page but suffice to
say
that's not an option due to time contraints.

Thanks.

Feb 16 '07 #4
"MattM" <Ma***@discussions.microsoft.comwrote in message
news:4E**********************************@microsof t.com...
I'm starting to think that this just isn't possible without frames.
Is there any particular reason you don't want to use an <iframe>? Seems like
the perfect solution here...
Feb 16 '07 #5
The main reason for not wanting to use <iframeis to do the right thing.
Everything I read on the subject thus far implied that not only does
Microsoft want you to stop using frames with Visual Studio 2005, but the
developer community also seemed to agree it was well past time to do so.

But, I might look into it just to see if it causes more problems that it
solves. I had hoped that since this can be done in Sharepoint it would be
possible to port the web part to ASP .Net.

"Mark Rae" wrote:
"MattM" <Ma***@discussions.microsoft.comwrote in message
news:4E**********************************@microsof t.com...
I'm starting to think that this just isn't possible without frames.

Is there any particular reason you don't want to use an <iframe>? Seems like
the perfect solution here...
Feb 16 '07 #6
Hi,

MattM wrote:
The main reason for not wanting to use <iframeis to do the right thing.
Everything I read on the subject thus far implied that not only does
Microsoft want you to stop using frames with Visual Studio 2005, but the
developer community also seemed to agree it was well past time to do so.
You are confusing frames and IFRAME. An IFRAME is quite OK to display
external content in a given webpage, in fact it's often the only way.

The alternative would be to load the ASP page on the server using a
HttpWebRequest object
(http://msdn2.microsoft.com/en-us/lib...ebrequest.aspx)
and then parse the HTML code and add it into your ASPX page. It's doable
and would be cleaner.
But, I might look into it just to see if it causes more problems that it
solves. I had hoped that since this can be done in Sharepoint it would be
possible to port the web part to ASP .Net.
HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Feb 18 '07 #7
"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:Ok**************@TK2MSFTNGP04.phx.gbl...
You are confusing frames and IFRAME. An IFRAME is quite OK to display
external content in a given webpage, in fact it's often the only way.
Definitely!
The alternative would be to load the ASP page on the server using a
HttpWebRequest object
(http://msdn2.microsoft.com/en-us/lib...ebrequest.aspx)
and then parse the HTML code and add it into your ASPX page. It's doable
and would be cleaner.
That would be fine for the pure HTML, but what about images, CSS etc...?
Feb 18 '07 #8
Hi,

Mark Rae wrote:
"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:Ok**************@TK2MSFTNGP04.phx.gbl...
>You are confusing frames and IFRAME. An IFRAME is quite OK to display
external content in a given webpage, in fact it's often the only way.

Definitely!
>The alternative would be to load the ASP page on the server using a
HttpWebRequest object
(http://msdn2.microsoft.com/en-us/lib...ebrequest.aspx)
and then parse the HTML code and add it into your ASPX page. It's doable
and would be cleaner.

That would be fine for the pure HTML, but what about images, CSS etc...?
CSS and JavaScript code added in the HEAD section has to be parsed from
the ASP page and added to the ASPX page's HEAD. CSS code inline can
simply be added as-is. External files (JavaScript, CSS, images) can be
left on the original server, and the reference to them parsed and added
to the ASPX page as-is, since there is nothing preventing the call to a
3rd party server to be done for these elements.

Doable doesn't mean easy, but it can be done :-)

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Feb 18 '07 #9
Perhaps you're correct and in my searches I was confusing IFrame and frames.
I was also thrown by the fact that IFrames is not on the toolbar for VS 2005,
which usually means it's not recommended.

I did a quick test with an <iframeand it worked with 5 minutes. I'm not
sure it will work with master pages as easily, or if there will be any other
issues, but it's good so far. I would prefer something like the web part for
SharePoint but it's better than nothing.

Thanks for the help.

"Laurent Bugnion [MVP]" wrote:
Hi,

MattM wrote:
The main reason for not wanting to use <iframeis to do the right thing.
Everything I read on the subject thus far implied that not only does
Microsoft want you to stop using frames with Visual Studio 2005, but the
developer community also seemed to agree it was well past time to do so.

You are confusing frames and IFRAME. An IFRAME is quite OK to display
external content in a given webpage, in fact it's often the only way.

The alternative would be to load the ASP page on the server using a
HttpWebRequest object
(http://msdn2.microsoft.com/en-us/lib...ebrequest.aspx)
and then parse the HTML code and add it into your ASPX page. It's doable
and would be cleaner.
But, I might look into it just to see if it causes more problems that it
solves. I had hoped that since this can be done in Sharepoint it would be
possible to port the web part to ASP .Net.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Feb 19 '07 #10

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

Similar topics

0
by: Wynter | last post by:
RE: from Displaying a Document using the ASPNET user account to the Client Browser discussion (3/2/2004 Buddy Thanks for helping me on getting the document to display. But now I am left with a...
2
by: Carole MacDonald | last post by:
There have been lots of posts on this topic, but I haven't been able to apply any of the suggestions to my situation. I have an .aspx page with a form on it that has several submit buttons on...
0
by: Fronky | last post by:
Hope someone can help. I am still learning, so no laughing please. I am displaying records from a database using Response.Write(""); instead of the usual datagrid method. I am doing it this way...
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
0
by: Coco | last post by:
Hi! I have been searching for solution for the problem i am facing in displaying chinese character in my aspx page initially when i created the aspx page with some chinese chaarcter, it worked...
2
by: mazdotnet | last post by:
Hi, I have the following code in the code-behind file public string section; section = Request.ToString() and I like to display it in my .aspx page (included .ascx) but it's not working.
15
by: Kevin Hanken | last post by:
Hi, Pretty much a newbie to aspnet and xp -- I am using XP Pro, Service Pack 2. I installed IIS, set up a virtual directory, created an aspx file and pasted in a little code from the w3schools...
11
by: pardesiya | last post by:
Friends, I am having trouble displaying Japanese text within a textbox (or anywhere else) in an aspx page with .net 2.0 framework. Initial default text in Japanese displays perfectly but when I...
7
by: hsegoy1979 | last post by:
Dear All Iam using file upload control and i want to display image in another pop up page .But image is not displaying in image control iam sending image path thru querystring . here is my code ...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.