Mixing ASP.NET pages with ASP Pages in windows server 2003 IIS - asp.net

I've got a lot of Classic ASP pages in production on a Windows Server 2003 64-bit machine. I've also got .NET on there working.
I'm starting to move the ASP ajax pages (pages that receive ajax calls from the Classic ASP) to ASP.NET/C# to take advantage of the business/data/logging layer I've got set up there in C#.
I've figured on securing the ASPX pages by way of a "token" that I create in the database in ASP and then pass to the ASPX page, which then uses it to validate that it's a legit call and destroys it.
My big question is - aside from making the ASPX pages, do I need to compile the app into the same site as the ASP site? I assumed I'd do that - deploy it there alongside the ASP Classic pages, and then just call the ASPX individually as needed.
Is this strategy sound? Do I need to do anything special for performance or configuration to make ASP Classic and ASP.NET coexist well?
Thanks - this migration has been a bear because of the extreme asp classic dependency.

It will work just fine. I've seen it on several sites. Just put them all in the same directory.
Your biggest issue will be that the ASP and ASP.NET pages will each have their own SESSION and APPLICATION variables which won't be shared between the two. If you are using session variables in either it can force you into doing a lot of hacks to make it all work together well.

Related

combine classic asp with asp.net

I have a (huge) website written in classic asp. Now do I have to switch to vb.net (razor). Is there a way to combine those 2 till the switch is complete ?
Is there a way to let the application work with classic asp and vb.net ?
(I use webmatrix)(don't know if this is important information)
The reason I ask this is because the website contains more than
MSDN says you can run .asp and .aspx on the same server
ASP and ASP.NET can both be used on the same Web server. That is, a
Web site or Web application within a site can contain both ASP.NET
pages and ASP pages. Because both ASP and ASP.NET pages can be
accessed from the same Web server, you are not required to port your
existing ASP pages over to ASP.NET-compatible pages. [...]
https://msdn.microsoft.com/en-us/library/ms973813.aspx

Integrate classic ASP with ASP.NET

I have a classic ASP site hosted on IIS and I need to add new pages to the site, but the new pages have to be ASP.NET; I created few pages put them in the same directory and they are working fine.
My problem is the classic ASP and ASP.NET pages are not sharing the sessions. The website on IIS is configured as InProc and use cookies, so my goal is if ASP.NET page defined session as
session("abc")=5
The classic ASP page that is on the same website and directory could read its value. Thanks in advance.
You can give a read to this :
http://msdn.microsoft.com/en-us/library/aa479313.aspx
On a whim as I have seen this before, but what do you see in the Applications Pools of the IIS Settings for your application? Is it set to .NET CLR Version # or something like that? Because that is what you want for .NET .. but if you want Classic ASP sessions, you need to set that to "NO MANAGED CODE" instead and the Managed Pipeline Mode needs to be set to Classic. Now I don't know how well these work back and forth from NET to CLassic .. but I know if you don't set it to Classic mode your sessions just go poof on you for no reason .. sometimes hold for an hour, sometimes gone on the next click 1 minute later. But long story short, if you have any classic asp .. you need it to be set this way or otherwise your sessions seem to just not work properly because it handles them with .NET techniques otherwise.

Can you mix ASP and ASP.NET?

I am working on a mobile site that uses .aspx for the pages; however, I am transferring information from older .asp pages. These .asp pages are reading database connections, and I am not clear how to convert these into .aspx pages without running into config errors that are unclear to me in fixing.
Is it bad practice to mix .asp and .aspx pages in a site? If not, how can I learn to better understand the conversion differences from .asp database connections to .aspx? This is the only obstacle I have going on at the moment with this site, and I would love to find a solution soon as I've been stuck here for a while.
The site works, but I would like to be consistent with the .aspx set up in pages. I appreciate any help you may have to offer, thank you.
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.

Persisting sensitve data in asp.net, odd implementation

For reasons not in scope of this question I have implemented a .net project in an iframe which runs from a classic asp page. The classic asp site persisted a few sensitive values by hitting the db on each page.
I have passed there variables as xml to the aspx page, now I need to make these values available on any page of this .net site.
I've looked into the cache object but we are on a web farm so I am not sure it would work.
Is there a way I can can instantiate an object in a base page class and have other pages inherit from the base page to access these values?
What is the best way to persist these values?
A few more points to consider the site runs in https mode and I cannot use session variables, and I would like to avoid cookies if possible..
Perhaps I've misunderstood but, if the ASP classic pages were just hitting the db why didn't you just have the ASP.Net pages do the same? That would certainly solve the web-farm issue and is probably why the ASP classic pages work that way to begin with.

Why can I not get application object in classic ASP when I add a .NET Wildcard mapping to directory?

We're migrating a site from classic asp to .NET. In the process, I need to use .NET authentication to secure the classic asp pages. This works great with wildcard mapping...unless the classic asp pages try to use something like the Application object.
I have tried adding an HTTPHandler to pass the request to the asp.dll, but to no avail.
Is what I am trying to do even possible?
Are you trying to have some of your old 'classic' asp pages within the same site as the .aspx pages? We've done something similar here, but we wound up with two websites, one for the asp and one for the .net and did some session sharing to perform the authentication.
It is possible on IIS7 using the integrated pipeline, I would say it would be highly fragile on IIS6 with wildcard mapping.

Resources