Results 1 to 4 of 4

Thread: How to define a procedure?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229
    Dear all,

    Does anyone know how to define a procedure/sub/function in ASP?

    For example file name Test.asp
    (this code does not work):

    <%
    Response.Write ("<input type=button value=Answer name=cmdAnswer onClick='Answer'>")

    Sub Answer()
    ' code
    End Sub
    %>

    Thanks in advance
    Keiko

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    The onclick will only call a sub/function on the client side so that will not work becuase the sub you wrote is server side.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Lively Member harsoni's Avatar
    Join Date
    Oct 2000
    Posts
    118
    Put this function in the client script..

    <%
    Response.Write ("<input type=button value=Answer name=cmdAnswer onClick='Answer'>")
    %>
    .....
    <SCRIPT language=VBSCRIPT>
    Sub Answer()
    ' code
    End Sub
    </SCRIPT>

    Sonia

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Wink

    Thanks Cander and harsoni

    Keiko

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width