Can ASP & ASP.NET Apps Be Hosted in Same Site?

S

Steve

I have mixed ASP.NET and classic ASP apps environment,
ASP.NET needs to invoke classic ASP. I had problems to put
these two apps in the same site(or vir-dir). It seems
that IIS gets confused by the co-existing global.asa and
global.asax. If I removed global.aspx but left global.asa
with Web.config in the root, used only .aspx (no code-
behind) and eliminated /bin folder. It would work just
fine. I can type both .asp and .aspx in the browser and
IIS rendered properly. But the ASP.NET features can not
be fully utilized.

Can anyone point out if both ASP.NET and classic ASP apps
can be hosted in the SAME site without interfering the
other, and how to do it properly. It would be nicer if
there are some links to a walk-thru or articles. Thank
you very much.
 
Y

Yan-Hong Huang[MSFT]

Hello Steve,

In theory this should work, as they are both implemented in different
binaries and register different extensions with IIS. I also don't know of
any specific problems that people have had.

Here is some conversations on asp and asp.net in MSDN:

Q: Could you comment on interoperability (via Session Objects, Query
Strings, etc.) between ASP and ASP.NET? Any gotchas?

Mark Anders: There are a few. First, we've made the object models as close
as possible. However, if for example you store COM objects (not new CLR
objects) in sessions, and you want those to be out of proc, they won't
work. You need to have new objects that can be serialized. One thing to
note is that ASP and ASP.NET will run side by side on a box, because at an
application level ASP and ASP.NET do not share sessions.

Q: I've seen a lot of concern that data can be passed page to page (ASP to
and from ASP.NET).

Mark Anders: Since we really use standard Web techniques, passing info page
to page should not be a problem. However, page to page in ASP and ASP.NET
typically assumes services that are provided by each, such as session and
application state. These services are not shared, and so you can't rely on
them.

Scott Guthrie: I have a list of things you can do to ease migration of ASP
code to ASP.NET.

1) Use only a single language within the ASP application. Don't intermix
VBScript and JScript together in the same page (in general a bad
programming practice with ASP, but also a migration issue for ASP.NET in
that we now require only one inline <% %> language.

2) Explicitly declare all of ASP page functions within a <script
language="VBScript" runat=server> block as opposed to <% %> blocks. In
ASP.NET we no longer support this later function declaration option. It is
just a copy/paste change in order to fix I

3) Explicitly use VBScript's "Option Explicit" keyword at the top of every
ASP Page (this will become the default with ASP.NET and will also ensure
that you write slightly better code today).

4) Use the "Call" keyword anytime they call a subroutine in VBScript today
(for example: "Call FooBar (1, 2)"). This will enable/require them to wrap
parenthesis around all subroutine arguments (if you don't use the "call"
keyword, then VBScript today will raise a compilation error if you have
parentheses). In VB.NET, parentheses are now required (note that the "call"
keyword is still supported in VB.NET). So if they didn't use the "call"
keyword, they'd have to go back and change all subroutines.

5) Avoid relying on "default properties" in VBScript, and instead fully
qualify property references: (For example, with an ADO Recordset write:
rs("a_name").Value instead of just rs("a_name")). Default properties are no
longer supported in VB.NET.

6) Avoid using "render function" tricks (a specific unintended hack/trick
that people can use in ASP but which was never intended as a feature).
Instead explicitly use Response. Write blocks when constructing render
functions.

Hope it helps.

Best regards,
yhhuang
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
--------------------
!Content-Class: urn:content-classes:message
!From: "Steve" <[email protected]>
!Sender: "Steve" <[email protected]>
!Subject: Can ASP & ASP.NET Apps Be Hosted in Same Site?
!Date: Mon, 30 Jun 2003 21:28:14 -0700
!Lines: 16
!Message-ID: <[email protected]>
!MIME-Version: 1.0
!Content-Type: text/plain;
! charset="iso-8859-1"
!Content-Transfer-Encoding: 7bit
!X-Newsreader: Microsoft CDO for Windows 2000
!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
!Thread-Index: AcM/iS/i78pDdUOzSHebU/3sLespHg==
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!Path: cpmsftngxa09.phx.gbl
!Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:31280
!NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
!
!I have mixed ASP.NET and classic ASP apps environment,
!ASP.NET needs to invoke classic ASP. I had problems to put
!these two apps in the same site(or vir-dir). It seems
!that IIS gets confused by the co-existing global.asa and
!global.asax. If I removed global.aspx but left global.asa
!with Web.config in the root, used only .aspx (no code-
!behind) and eliminated /bin folder. It would work just
!fine. I can type both .asp and .aspx in the browser and
!IIS rendered properly. But the ASP.NET features can not
!be fully utilized.
!
!Can anyone point out if both ASP.NET and classic ASP apps
!can be hosted in the SAME site without interfering the
!other, and how to do it properly. It would be nicer if
!there are some links to a walk-thru or articles. Thank
!you very much.
!
 
G

Guest

We have asp and asp.net running on the same site without any problems. But
the asp.net stuff is in it's own subdirectory.
 
K

Kevin Spencer

What behavior are you seeing that makes you think that "IIS gets confused by
the co-existing global.asa and global.asax"?

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.
 
S

steve

THANK YOU ALL, IT IS WORKING!
Classic ASP and ASP.NET can run side by side under ONE SITE
(i.e. same IP Address).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top