将外部网站加载到我的.aspx页面 [英] Load external website to my .aspx page

查看:87
本文介绍了将外部网站加载到我的.aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想在我的网站项目中显示任何外部www.xyz.com网站的内容使用ASP.NET / C#。



- 到目前为止,我已经尝试了HTML iframe标签

Hi,

I want to show the content of any external www.xyz.com website in my web project that is built using ASP.NET/C#.

- so far I have tried the HTML iframe tag

<iframe id="myiframe" src="https://developer.mozilla.org/en/docs/Web/HTML/Element/iframe"></iframe>



并且这不会显示任何内容(空iframe),因为此标记仅适用于我的o内(包含)的页面wn project。



- 我还尝试使用JQuery将内容加载到div标签中,使用以下JQuery 加载 功能但似乎没什么用。


and this does not display anything (empty iframe) because this tag only works with pages that are within (contained) in my own project.

- I also tried to use JQuery to load the content into a div tag using the following JQuery load function but nothing seems to work.

jQuery(document).ready(function () {
  $("#testLoad").load("http://www.google.com");´
});





此代码只返回错误找不到任何网站,但相信我,www.google.com它确实存在。



任何想法如何实现这种方法在iframe中加载任何外部网站的内容或使用C#加载任何其他替代方案?



提前致谢!



this code just return error Not Found for any website, but trust me, www.google.com it does exists.

any idea how can I achieve this approach of loading the content of any external website within an iframe or with any other alternative using C#?

Thanks in advance!

推荐答案

#testLoad)。load( http://www.google.com);'
});
("#testLoad").load("http://www.google.com");´ });





此代码只返回错误找不到任何网站,但相信我,www.google.com它确实存在。



任何想法如何实现这种方法在iframe中加载任何外部网站的内容或使用C#加载任何其他替代方案?



提前致谢!



this code just return error Not Found for any website, but trust me, www.google.com it does exists.

any idea how can I achieve this approach of loading the content of any external website within an iframe or with any other alternative using C#?

Thanks in advance!


您可以使用jQuery UI库以简单的方式完成。

如下例所示: -



http:// jsfiddle.net/smrutis1984/qar7zf03/5/



希望会有所帮助。
You can do it in simple way using jQuery UI library.
As displayed in below example :-

http://jsfiddle.net/smrutis1984/qar7zf03/5/

Hope will be helpful.


这篇关于将外部网站加载到我的.aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆