By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Displaying ASP page in ASPX page

P: n/a
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
Share this Question
Share on Google+
9 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.