Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#include ASP header in ASP .NET page

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi all

Apologies if this has been covered before - the search functionality seems to be down for maintenance [sad]

A new look & feel has been developed for one of our applications (written in ASP) and I am required to include my ASP .NET application as a subdirectory under the ASP application. I also need to include the ASP header & footer on my ASP .NET pages to get the correct look and feel.

I used the #include directive to include the ASP page - but I get the following error:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1044: Cannot use more than one type in a for, using, fixed, or declaration statement

Source Error:



Line 1: <%
Line 2: Dim strProductSuite, strProduct, strMarketingVersion, strProdDevReleaseVersion
Line 3: Dim strProdDevInternalVersion, strSystemTitle
Line 4:
Line 5:

So the page is obviously trying to parse the VBScript in the ASP page as C# code [hammer]

Does anyone have any ideas on how to indicate to my page to parse the include file as plain ole ASP and the rest as .NET code (without changing the ASP page)? Any help on this would really be appreciated.

Thanks as always



Craftor
:cool:
 
Hi Digimon02

Would this be in my #include directive? If I include it:
Code:
<!-- #Include File="../Includes/incHeader.asp" Script="VBSCRIPT" runat="SERVER"-->

I get an error saying "The server tag is not well formed."

Thanks as always

Craftor
:cool:
 
You can't combine classic ASP and ASP.NET on the same page (although it can be used in the same project).

-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
 
Urgh that is going to cause problems!! My boss didn't want there to be replication of code between the projects.

I guess the best solution is to recreate the functionality as closely as possible in C# with usercontrols.

Thanks for the advice!

Craftor
:cool:
 
One really ugly way to get around replication would be to use frames. I'd totally suggest against it, but it's your project... :)

I'd recommend recreating the functionality with user controls. It would probably be best to get it done and out of the way now for future development. The more you rely on "spaghetti" code, the more chance there is of a really hard-to-debug major show-stopping bug further down the road.

-----------------------------------------------
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top