locked
How to load an external website /an external web page inside a web app? RRS feed

  • Question

  • Hi,

    I am trying to load a web page inside another web page. I have tried to use jquery, node.js, javascript but without any success.

    I am not allowed to use embedded controls like iframe or object. Not sure, what it should be approach to do this. What technologies I should use? Maybe to use an webpage to load another webpage from different domain isn't the right approach.

    Thanks!

    • Moved by CoolDadTx Friday, June 21, 2019 2:10 PM ASP.NET related
    Friday, June 21, 2019 11:35 AM

All replies

  • If you want to do it from javascript, you need to be careful to ensure that the CORS permissions allow it. If you can't manipulate the HTTP headers to enable CORS, then the alternative is to load the external page from server code (for instance, use WebClient.DownloadString), and then embed the html (properly sanitized to remove unwanted tags such as <head> and <body>) inside the page that you are serving to the browser.
    Friday, June 21, 2019 11:53 AM
  • Hi Alberto,

    Thanks for your help!

    I can't use javascript because of CORS; I think that the approach with the server side could be a solution, I start investigating.

    Friday, June 21, 2019 12:04 PM
  • Hi Alberto,

    Thanks for your help!

    I can't use javascript because of CORS; I think that the approach with the server side could be a solution, I start investigating.

    ASP.NET and JavaScript issues can be discussed at the ASP.NET forums.

    http://forums.asp.net/

    Friday, June 21, 2019 12:17 PM