You can't use RenderPage to display a page from another site. The RenderPage method expects the path (virtual or absolute) to a file, not the URL of a different site.
Was sizing box using % set in Px now fills the box. On the original question is there a helper to do the displaying of URL's would be nice to have it displayed to size of container box not kept at its original size. Anyway thanks for help will need help
again soon no doubt, but getting there. Last question I am using the style sheet off the Starter site, can you change this so it only displays in full, when you size window after a point all starts to overlap, sooner just have the one Size. Thanks
Marked as answer by Espace on Jul 02, 2012 01:54 PM
Espace
Member
2 Points
29 Posts
Displaying a webpage from another site on my site
Jul 01, 2012 12:28 PM|LINK
I need to display a web page from another site on my site but get errors.
'http:/www.google.co.uk/' is not a valid virtual path.
Line 172: @google
Line 173:
Line 174: <a @Href(google) ></a>
Line 175: @Href(google)
Line 176: </td>
This is causing me a major problem, I have tried different things but dont understand. Help
<table border="1">
<tr>
<td>Requested URL</td>
<td>Relative Path</td>
<td>Full Path</td>
<td>HTTP Request Type</td>
</tr>
<tr>
<td>@Request.Url</td>
<td>@Request.FilePath</td>
<td>@Request.MapPath(Request.FilePath)</td>
<td>@Request.RequestType</td>
</tr>
</table>
aspnet2sams
Participant
1734 Points
540 Posts
Re: Displaying a webpage from another site on my site
Jul 01, 2012 01:47 PM|LINK
Espace
<a href="http://google.co.uk/">some text here</a> is the way to use the html tag as in post the url is the href value.
Espace
Member
2 Points
29 Posts
Re: Displaying a webpage from another site on my site
Jul 01, 2012 03:22 PM|LINK
Hi,
Thanks for the reply will try above see if works. But I wanted the page to display within one of my own pages using
@RenderPage() code as follows
@{
var google = http://www.google.co.uk/;
}
<body>
@RenderPage(@Href(google))
@RenderPage(google)
</body>
Error message
'http:/www.google.co.uk/' is not a valid virtual path.
Exception Details: System.Web.HttpException: 'http:/www.google.co.uk/' is not a valid virtual path.
Mikesdotnett...
All-Star
154818 Points
19853 Posts
Moderator
MVP
Re: Displaying a webpage from another site on my site
Jul 01, 2012 03:43 PM|LINK
You can't use RenderPage to display a page from another site. The RenderPage method expects the path (virtual or absolute) to a file, not the URL of a different site.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
Espace
Member
2 Points
29 Posts
Re: Displaying a webpage from another site on my site
Jul 01, 2012 04:03 PM|LINK
Have found a way using <iframe> tag, only problem web page doesn't fit the table box, any ideas?? Thanks
Mikesdotnett...
All-Star
154818 Points
19853 Posts
Moderator
MVP
Re: Displaying a webpage from another site on my site
Jul 01, 2012 06:10 PM|LINK
Increase the size of the box?
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
Espace
Member
2 Points
29 Posts
Re: Displaying a webpage from another site on my site
Jul 01, 2012 07:05 PM|LINK
Was sizing box using % set in Px now fills the box. On the original question is there a helper to do the displaying of URL's would be nice to have it displayed to size of container box not kept at its original size. Anyway thanks for help will need help again soon no doubt, but getting there. Last question I am using the style sheet off the Starter site, can you change this so it only displays in full, when you size window after a point all starts to overlap, sooner just have the one Size. Thanks
mclazarini
Member
63 Points
57 Posts
Re: Displaying a webpage from another site on my site
Jul 01, 2012 08:53 PM|LINK
I don´t know what´s your real goal but why don´t you use a Jquery Plugin to open a windows in the same page as soon the user click in the link!?
here is an example...
http://www.jacklmoore.com/colorbox