• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 851
  • Last Modified:

Classic ASP Post variables in redirect

OK, I know I'm missing something obvious here, but it's been a while and I'm rusty. I have a form that submits to a .asp page where I scrub the passed variables and then need to pass those variables using the Post method to a .dll. These are all on the same server so there are no issues with security, etc.

I've tried the WinHttpRequest object however I'm looking to continue on to the page, not simply receive a response back.

Obviously Response.Redirect works with querystrings, etc.

I swear I've done this before and I think I'm just looking for the wrong needle in the internet forum haystack.

Thanks for your help!
  • 3
  • 3
  • 2
2 Solutions
Dave BaldwinFixer of ProblemsCommented:
using the Post method to a .dll doesn't make any sense.  POST is an HTTP method used with a web server, not just a file.  And I'm pretty sure that 'Redirect's dump any POST info.

Do you have an API or sample code that shows how to connect to the dll?
mwidholmAuthor Commented:
Sure, I'm not incredibly familiar with rendering .dlls in a web browser so I probably could've phrased that better.

strDestinationURL = "http://domain.com/ProprietaryCPlus.dll"

strContent = strContent & "Var1=" & Var1
strContent = strContent & "&Var2=" & Var2

Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttp.Open "Post",strDestinationURL
Dave BaldwinFixer of ProblemsCommented:
I would make up a standard HTML form to test to see what happens.  In theory, any page that responds with 'text/html' can be displayed in a web browser.  This should be good for a test after you change the link and values to the correct ones.
<!DOCTYPE html>
<title>dll Test Form</title>
<form action="http://domain.com/ProprietaryCPlus.dll" method="post">
First name: <input type="text" name="Var1" value="?" /><br />
Last name: <input type="text" name="Var2" value="?" /><br />
<input type="submit" value="Submit" />

<p>Click the "Submit" button and the input will be sent to a page on the server called "ProprietaryCPlus.dll".</p>


Open in new window

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Scott Fell, EE MVEDeveloperCommented:
I think you want server.createobject

if request.form("field1")<>"" then ' start scrubbing

 '/////step1 scrub code /////
field1=  replace(request.form("field1"),"'","")
field10=  replace(request.form("field10"),"'","")

'////// step 2 use the com object ///////
Set something = Server.CreateObject("theDll.class") 'class set up in the dll
    ...do some code....
'/////// step 3 redirect
end if 'if request.form("field1")<>""
....form fields ......

mwidholmAuthor Commented:
We already have a form that submits successfully to the .dll, so we know that works.

I'm going to pass on the server-side scrubbing for now and just submit directly.

Thanks for the help.
mwidholmAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for mwidholm's comment #a38407580
Assisted answer: 250 points for DaveBaldwin's comment #a38407113

for the following reason:

Went with a workaround for now.
Scott Fell, EE MVEDeveloperCommented:
I didn't think your question was about scrubbing, it was about accessing the dll.  That typically accessed with server.createobject.  Did you access the dll in another way?  how?
Scott Fell, EE MVEDeveloperCommented:
I didn't see that points were awarded, I was just curious as to the final solution.  Please keep the points awarded as is.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now