1

We are in the process of replacing a classic ASP site with an ASP MVC site. Currently it's running as a hybrid of the two.

I'd like to reduce the amount of duplication that we starting to see. Is it possible to take the result of an asp mvc view and embed it directly into a classic asp page? To be clear, I am not wanting to use IFrames, the result of the mvc view should become part of the rendered html.

ilivewithian
  • 19,476
  • 19
  • 103
  • 165
  • It's not fine grain enough, in some instances, the shared section might only render a piece of inline text (the work to get t would be non trivial) – ilivewithian Aug 08 '12 at 07:58

1 Answers1

2

Ajax maybe?

I would use jQuery implementation of Ajax with something like this:

Html:

<div id="ASPNET_DATA_HERE"></div>

jQuery:

$('#ASPNET_DATA_HERE').load('http://AspNetHost.com/TheNewMvcWebsite');

This might not suite your needs but with the limited information you supplied, that's all I could come up with. I'll update this post if you supply more information.

Pluc
  • 2,909
  • 1
  • 22
  • 36
  • I need the code to be rendered in-line to the page (i.e server side), not just injected after the page has loaded. – ilivewithian Aug 08 '12 at 08:13
  • Then I'm afraid the answer is no as this is the closest "feel" you'll acheive. You cannot do server-side processing between different server/services without major "hacks". – Pluc Aug 08 '12 at 11:07
  • Any reason you want it to be server side? – Pluc Aug 08 '12 at 11:08
  • The content needs to be inline for SEO. – ilivewithian Aug 08 '12 at 16:22
  • You have a good point. Well the only way to do it is a really ugly hack. Something like this http://stackoverflow.com/questions/4510212/how-i-can-get-web-pages-content-and-save-it-into-the-string-variable – Pluc Aug 08 '12 at 16:36