Common code for classic asp and

Hi Expert,
we have an application that has both classic asp and dot net pages hosted on IIS.We have COM DLL's that get called from classic asp pages and do the talking with db.and we have a solution that contains All dot net modules.Now we have a requirement of applying an algorithm say masking of certain specific data which gets displayed both on asp and pages .How do we write a common code, that caters to both the pages.Writing logic on db side is not an option i am looking for.I have thought of wcf service that could be called from both asp and is there any other option may be like creating a dll and putting into gac or any thing else.Please suggest some articles or case studies that can help me achieve this.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DevildibAuthor Commented:
Any update?
Assuming that  you are generally doing your new development work in .NET as opposed to Classic ASP, I think it's better to write new features in .NET. That opens up these options for you:

Create a web service and call the web methods or RESTful APIs from javascript (client side) code
Classic ASP Pages can use libraries such as jQuery to call a RESTful api, which is just an exercise in calling web services from HTML pages). You can use ASP.NET Web API to quickly create these APIs.

Calling the web service from server side Classic ASP
With this approach, you call the web services in server side Classic ASP code. I personally don't really like this option much.

Expose .NET DLLs through COM and access these from Classic ASP (server side code)
Write the code in .NET assemblies and register these DLLs for COM. That way, you can use them directly from your Classic ASP page. The .NET components can do whatever complicated stuff you need. In Visual Studio, make the assembly visible for COM ( and on deployment machines, use RegAsm to register the .NET DLL ( In your Classic ASP page, call CreateObject to create and return a reference to a new instance of the class defined in the dll, and then call the appropriate method. Example:
Dim obj As Object
Set obj = CreateObject("MyLibrary.TheClassIWantToUse")

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.