tags:

views:

76

answers:

1

i have a current asp website that i need to keep in sync but it has stuff like this:

<!--#include file="inc_search_form.asp" -->

i can't change this file at all as it exists in another asp website so i can't break that compatibility..

is there anyway i can just shove this same file into my asp website and have it work the same?

+1  A: 

There is an assumption here that the other asp website may want to change the content of this asp file and you would want such changes reflected in your new website. If that isn't the case you would simply create ASP.NET version of this content in your new webstie.

There isn't really enough info in your question for a good answer to you specific scenario.

To the general scenario the answer is a flat no.

However there may be some mitigation depending on what the include actually does. For example it may be possible simply read the ASP file in ASP.NET perhaps do some text based tweaking and include the final HTML content in your ASP.NET pages output. This approach though is very fragile if the include is subject to change (if not see first paragraph in this answer).

Another mitigation might be if the include file can generate the desired content when requested directly, in this case you may get away with making HttpWebRequest looping back to this ASP page whilst processing the ASP.NET page. Ugly and again fragile but possible.

To what extent does the include file depend on the includer to have created a context for it? For example does the include file use variables that it expects the includer to have created? In which case the answer is no.

Does the include expect to be placed in a specific part of an overal HTML page, does it contain inline Javascript and does it attempt to interact with other parts of the containing page? Loop back HttpWebRequest might work in this case.

The most likely answer is no. Even if the answer is yes what ever the solution it will be fragile. Personally I just wouldn't even attempt it despite any perceived benefits. In the long run maintaining a ASP.NET version of this content in parallel with the existing ASP version in the other site is much more tenable.

AnthonyWJones
thanks.. i just created a duplicate for now. a little messy but it works
ooo