PDA

Click to See Complete Forum and Search --> : How to define a procedure?


Keiko
Mar 26th, 2001, 08:20 PM
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

Cander
Mar 27th, 2001, 09:36 AM
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.

harsoni
Mar 27th, 2001, 09:41 AM
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

Keiko
Mar 27th, 2001, 08:06 PM
Thanks Cander and harsoni

Keiko