Common code for classic asp and asp.net

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 asp.net 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 asp.net.but 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.
DevildibAsked:
Who is Participating?
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?
0
MlandaTCommented:
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.
http://encosia.com/using-jquery-to-post-frombody-parameters-to-web-api/
http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/?ref=sidebar_most_popular

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.
http://www.aspfree.com/c/a/ASP/Consuming-a-WSDL-Webservice-from-ASP/
http://weblogs.asp.net/cabhilash/calling-web-services-in-classic-asp

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 (https://msdn.microsoft.com/en-us/library/vstudio/w29wacsy(v=vs.100).aspx) and on deployment machines, use RegAsm to register the .NET DLL (http://www.jagjot.com/2014/01/register-c-vb-net-dll-regasm-gacutil/). 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")
obj.FunctionName(parameters)

Open in new window

0

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
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.