Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display web page from another site in asp page

Tags:

asp.net

embed

Our customer has a requirement to extend the functionality of their existing large government project. It is an ASP.NET 3.5 (recently upgraded from 2.0) project.

The existing solution is quite a behemoth that is almost unmaintainable so they have decided that they want to provide the new functionality by hosting it on another website that is shown within the existing website.

As to how this is best to be done I'm not quite sure right now and if there is any security issues preventing it or that need to be considered.

Essentially the user would log on to the existing web site as normal and when cliicking on a certain link the page would load as normal with some kind of frame or control that has within it the contents of the page from the other site. IE. They do not want to simply redirect to the other site they want to show it embedded within the current one such that the existing menus etc are still available.

I believe if information needed to be passed to the embedded page it would be done using query strings as I'm not sure if there is even another way to accomplish this.

Can anyone give me some pointers on where to start at looking to implement this or any potential pitfalls I should be aware of.

Thanks

like image 986
Daniel Powell Avatar asked May 27 '10 05:05

Daniel Powell


3 Answers

if the 2 sites are hosted from the same network (low latency between them) you could use state server for session management. that way, when you authenticate on one site, you will also be authenticated on the other, and share user state across them.

its pretty simple, in your web config of each web server you'd point to the state server (which could be located on one of the web servers)

<configuration>
  <system.web>
    <sessionState mode="StateServer"
       stateConnectionString="192.168.1.103:42424"
    />
  </system.web>
</configuration>

http://en.csharp-online.net/ASP.NET_State_Management%E2%80%94Storing_Session_State_out_of_Process

like image 93
Sonic Soul Avatar answered Oct 22 '22 16:10

Sonic Soul


create a virtual directory under the primary domain. If your domain is www.mydomain.com then create a virtual directory www.mydomain.com/site and port the new website application under /site virtual directory. This was linking should become very much relavant. With this the virtual-directory application will also retain all domain cookies set by primary domain.

like image 35
this. __curious_geek Avatar answered Oct 22 '22 16:10

this. __curious_geek


I would suggest to make the second website look exactly like the first one or at least use the same MasterPage, so you can redirect from one site to another without any visual difference.

If your site needs authentication, consider that you would need to do something to prevent the user to log in twice, an option could be to send an encrypted token to the second site.

All of this if you are forced to have a second site, if not just use a virtual directory

like image 1
alejandrobog Avatar answered Oct 22 '22 18:10

alejandrobog