Can you mix ASP and ASP.NET? Can you mix ASP and ASP.NET? asp.net asp.net

Can you mix ASP and ASP.NET?


You can absolutely mix ASP pages with ASP.NET pages. I've done it for internal sites where we didn't have time to redesign, but needed to add some functionality. Note that you can't share session state between the two types of pages (I worked around this using cookies) but the two pages can live together in the same web site without an issue.

Often ASP pages will have database connections kept in the global.asa file or perhaps in an include file, or even right within the asp pages themselves. It would be helpful as you migrate functionality to have all those connections in one logical place.

There is no straight conversion to ASP.NET from ASP, and if you don't have much experience yet with ASP.NET it would be worthwhile to explore some samples / tutorials to get an understanding of how an ASP.NET Web site works. There are lots of options for how you connect to your database. Have a look at www.asp.net to learn about them.


You can have the two running together. It's not necessarily a bad practice to mix the two, but here can be some technical things that you'll have to work out. Since it sounds like you're trying to convert a classic ASP site to ASP.NET, if there are not too many pages, I'd probably try to figure out the conversion issues so that all of your pages are running on ASP.NET.

Otherwise if you do want to run ASP and ASP.NET side by side, if your website has session state or authentication and you need that shared by both asp and asp.net pages, then you need to ensure that you have a strategy to handle that kind of stuff. This thread details session management issues to consider when running ASP with ASP.NET, for example: Classic ASP and ASP.NET Integration.