Jump to content

Passing variables to .cs classes (not a webform, and no Default.aspx)


trevor-
 Share

Recommended Posts

I have a web service that I've set up in .NET - c sharp, but I made it into three .cs files with various classes. I have a main (obviously), but I have no idea how to get variables from a classic ASP page into either my main routine, or into one of my classes. If I had a webform then I could put the elements in a form and the webform's Default.aspx could receive them, or I could use a querystrng and again the Default.aspx could receive them. How do I instead send them straight to a .cs file? This script, since it's a behind the scenes service, has to run behind the scenes and then pass a value back to my classic ASP application.Any hints?

Edited by trevor-
Link to comment
Share on other sites

  • 3 weeks later...
I have a web service that I've set up in .NET - c sharp, but I made it into three .cs files with various classes. I have a main (obviously), but I have no idea how to get variables from a classic ASP page into either my main routine, or into one of my classes. If I had a webform then I could put the elements in a form and the webform's Default.aspx could receive them, or I could use a querystrng and again the Default.aspx could receive them. How do I instead send them straight to a .cs file? This script, since it's a behind the scenes service, has to run behind the scenes and then pass a value back to my classic ASP application.Any hints?
You will need to compile a dll file then register it on your server, this is going to act as your gateway to the service and pass data back and forth. You will have to reference your service in the dll file you created. Your classic ASP pages will then make the calls to the registered dll file like so, sorry it is in vb.Dim objset obj = server.CreateObject("DLLFilename.ModuleClass")bAnswer = obj.FunctionOrSub(parameter1, parameter2)Hope this points you in the right direction.
Link to comment
Share on other sites

Ahh, thank you! I ended up just using SOAP instead because no one or myself could figure this out. But it was still bugging me, so I'm really happy that if I ever encounter this again I'll have a starting point. (Although I'm really hoping that I'll never have to do non-parallel programming in my life again...)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...