Classic ASP Post variables in redirect

Posted on 2012-09-17
Last Modified: 2012-09-29
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!
Question by:mwidholm
    LVL 82

    Expert Comment

    by:Dave Baldwin
    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?

    Author Comment

    Sure, I'm not incredibly familiar with rendering .dlls in a web browser so I probably could've phrased that better.

    strDestinationURL = ""

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

    Set objWinHttp = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
    objWinHttp.Open "Post",strDestinationURL
    LVL 82

    Accepted Solution

    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="" 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

    LVL 52

    Expert Comment

    by:Scott Fell, EE MVE
    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 some code....
    '/////// step 3 redirect
    end if 'if request.form("field1")<>""
    ....form fields ......


    Assisted Solution

    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.

    Author Comment

    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.
    LVL 52

    Expert Comment

    by:Scott Fell, EE MVE
    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?
    LVL 52

    Expert Comment

    by:Scott Fell, EE MVE
    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

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now