Jump to content
Sign in to follow this  
trevor-

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

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-

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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...)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...