Re: How to execute subroutines from button clicks?
From: Adrian Forbes [ASP MVP] (sorry_at_noemail.zzz)
Date: 03/26/04
- Next message: Ken Schaefer: "Re: Weird error windows 2003 server"
- Previous message: sean: "Weird error windows 2003 server"
- In reply to: Fred: "How to execute subroutines from button clicks?"
- Next in thread: Fred: "Re: How to execute subroutines from button clicks?"
- Reply: Fred: "Re: How to execute subroutines from button clicks?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 26 Mar 2004 02:08:18 -0000
Navigate to your page and View->Source and you'll probably see this
<SCRIPT LANGUAGE="VBScript">
Sub Dial()
end sub
</SCRIPT>
So clicking your button does nothing. ASP executes first and the resulting
HTML is handed to the browser for display.
The basic answer is that you can't do what you're wanting using standard ASP
coding. There are technologies that let you run things on the server via
things in script but without knowing the ins and outs of what you want it is
hard to advise further.
What does this CallDial do?
"Fred" <fdeckerNOSPAMM@aol.com> wrote in message
news:57baa4d8.0403251646.9bf30e6@posting.google.com...
> I have read and tried every combination for hours. I'm sorry, but I
> don't get it. How do I have a form with textboxes and buttons and
> allow click events to execute a server function then display a
> property on the client?
>
> Here is code, albeit changed to show both paths I have tried to
> follow, neither of which works. I also can't seem to find out how to
> trap for the errors so I can see what's going wrong.
>
> <%@ Language=VBScript %>
>
> <HTML>
> <HEAD>
> <META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
> <%
> Dim sNumber
> sNumber = "102"
>
> set etLine1 = Server.CreateObject("etTT40.etLine")
> etLine1.Enabled = True
> etLine1.DeviceName = "Analog Line 1(dxxxB1C1)"
> etLine1.DeviceActive = True
> response.write ("<br>etLine1.DeviceName: " & etLine1.DeviceName)
> response.write ("<br>" & etLine1.DeviceActive)
> 'all above code works. I can even dial if I stick the dial
> method here
>
> Sub Dial()
> etLine1.CallDial() ' Here is just get "error on page" at the
> ' bottom of my browswer
> End Sub
> %>
>
> <SCRIPT LANGUAGE="VBScript">
> <!-- This doesn't work, it just dials executes when the page loads
> even when
> I expect it to only get here with onclick
> Sub Dial()
> <%=etLine1.CallDial %>
> end sub
> -->
> </SCRIPT>
>
> </HEAD>
> <BODY bgcolor="#B0E0E6">
> End Sub
>
> <FORM NAME="CallerID">
> <p>Caller ID Number <input type="text"
> name="TextCallerIDNumber" size="20" value="<%=sNumber%>">
> <input type="button" name="btnDial" value="Dial This Number"
> onclick="Dial()"></p>
> <p>Caller ID Name <input
> type="text" name="TextCallerIDName" size="20">
> </p>
> <input type="button" name="btnHangup" value="Hangup Call"
> onclick="Hangup()">
>
> 'I even tried to put <%=CallDial() here to no avail
>
> </FORM>
> </HTML>
>
> This is obviously a telephony program and in this sample, I just want
> to be able to dial a call by pressing a button. The server has the
> hardware on it and would dial the call from there. I also would like
> to be able do dial into the server and the OnCallerID event should
> fire. I then want to display the caller ID on the client side.
> Thanks.
>
> Fred
- Next message: Ken Schaefer: "Re: Weird error windows 2003 server"
- Previous message: sean: "Weird error windows 2003 server"
- In reply to: Fred: "How to execute subroutines from button clicks?"
- Next in thread: Fred: "Re: How to execute subroutines from button clicks?"
- Reply: Fred: "Re: How to execute subroutines from button clicks?"
- Messages sorted by: [ date ] [ thread ]