Results 1 to 2 of 2

Thread: Call Server side SUB from button?

  1. #1

    Thread Starter
    Addicted Member wernerh's Avatar
    Join Date
    Sep 2000
    Posts
    170

    Question

    Is there a way to call a Server side sub procedure when a user clicks on a button??????

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    You need to post back to the server to call a serverside sub.
    Here's a VERY simple example...

    Code:
    <%@ Language=VBScript %>
    <html>
    <head>
    <body>
    
    <% 
    dim func
    func = request("f")
    
    select case func
    case 1
    	serverDateTime
    
    end select
    
    
    sub serverDateTime()
    
    response.write now
    
    end sub
    %>
    
    <FORM  method="post" action="clicktest.asp" Name="frm1">
    <input name=f type=hidden value=1>
    <input type=submit value="Click">
    
    </form>
    
    
    </body>
    </html>
    Mark
    -------------------

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