Solved

Run Server-Side Code from HTML Button Click

Posted on 2004-10-28
181 Views
Last Modified: 2012-08-13
Here is what I am trying to do, it may be impossible but I thought I would check with everyone here:

1) When the user clicks the html Button, I need a choose file dialogue box to open up.
2) I have a component for the dialoge box installed on the server.  
3) I want the user to be able to choose a file off of the SERVER and I do not want to have to install the "FileBrowse" .dll file on all the user's machines that will have access to it.

If I could just call a server-side function from the client-side, it would be great.  But nothing is working so far.  Anybody have any ideas????

0
Question by:jfkrueger
    4 Comments
     
    LVL 7

    Expert Comment

    by:rohanbairat3
    If at all you want a user to vie the directory ...might aswell set the directory browsing on for that directory in IIS.

    I dont think you can create a dialogue on server and show it on client side :) but u can write your own piece of code to the same function ...just send client the File and Directory names with nice graphics :)

    Dont know whether that helped you .
    -Rohan
    0
     
    LVL 2

    Author Comment

    by:jfkrueger
    Thanks for the reply rohanbairat3...

    Maybe I should have left out all of the details and just stuck with the issue I am having problems with.  Like I said before, from everything I know about ASP this is impossible, but who knows there may be a solution out there.

    <%@ Language=VBScript %>
    <%
    Sub test()
         do something
    End Sub
    %>

    <HTML>
         <INPUT TYPE="BUTTON" onClick="test()">
    </HTML>

    I need to call a server side function (test()) from a client-side button.  I do not want to call a client-side function (within <script> tags).

    Anybody have a solution????
    0
     
    LVL 7

    Expert Comment

    by:rohanbairat3
    Sorry You cannot call a ASp function within a javascript ...The only way is to submit the button to a different page or redirect it ...

    -rohan
    0
     
    LVL 12

    Accepted Solution

    by:
    It is possible to do it, by using <iframe>

    --- testFunction.asp ---

    <%@ Language=VBScript %>
    <%
    Sub test()
        do something
    End Sub
    %>

    ---- Test.asp -----

    <HTML>
    <script>
    function test()
    {
       document.getElementById("test_Frame").src = "testFunction.asp";
    }
    </script>
        <INPUT TYPE="BUTTON" onClick="test()">
        <iframe id="test_Frame" style="display:none">
    </HTML>

    -----------------

    you can pass values through the query string to testFunction.asp if needed.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This video discusses moving either the default database or any database to a new volume.

    884 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

    16 Experts available now in Live!

    Get 1:1 Help Now