Ask a Question related to ASP.NET Web Services, Design and Development.
-
conspawn #1
NEED HELP WITH CALCULATOR WEB SERVICE
Whats up guys, i am having difficulties coding the plus sign button on
my aspx page to store variable1, clear textbox, and store variable2
then call a web service to add both variables
my code so far is:
<%@ Page Language="VB" %>
<%@ import Namespace="WebSCalculator" %>
<script runat="server">
Private Sub btnZero_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnzero.Click
txtDisplay.Text = txtDisplay.Text & btnzero.Text
End Sub
Private Sub btnone_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnone.Click
txtDisplay.Text = txtDisplay.Text & btnone.Text
End Sub
Private Sub btntwo_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btntwo.Click
txtDisplay.Text = txtDisplay.Text & btntwo.Text
End Sub
Private Sub btnthree_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnthree.Click
txtDisplay.Text = txtDisplay.Text & btnthree.Text
End Sub
Private Sub btnfour_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnfour.Click
txtDisplay.Text = txtDisplay.Text & btnfour.Text
End Sub
Private Sub btnfive_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnfive.Click
txtDisplay.Text = txtDisplay.Text & btnfive.Text
End Sub
Private Sub btnsix_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnsix.Click
txtDisplay.Text = txtDisplay.Text & btnsix.Text
End Sub
Private Sub btnseven_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnseven.Click
txtDisplay.Text = txtDisplay.Text & btnseven.Text
End Sub
Private Sub btneight_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btneight.Click
txtDisplay.Text = txtDisplay.Text & btneight.Text
End Sub
Private Sub btnnine_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnnine.Click
txtDisplay.Text = txtDisplay.Text & btnnine.Text
End Sub
Private Sub cmdclear_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles cmdclear.Click
txtDisplay.Text = ""
End Sub
Private Sub period_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles period.Click
txtDisplay.Text = txtDisplay.Text +"."
End Sub
Private Sub cmdPlus_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles cmdPlus.Click
Dim Number1 as Double
Dim Number2 as Double
number1 = 0
Number2 = 0
number1 = number1 & txtdisplay.text
txtdisplay.text = ""
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p align="center">
<asp:TextBox id="Txtdisplay" runat="server"></asp:TextBox>
</p>
<p align="center">
<asp:Button id="btnseven" runat="server" Width="15px"
Text="7"></asp:Button>
<asp:Button id="btneight" runat="server"
Text="8"></asp:Button>
<asp:Button id="btnnine" runat="server"
Text="9"></asp:Button>
<asp:Button id="divide" runat="server"
Text="/"></asp:Button>
<asp:Button id="cmdclear" runat="server"
Text="c"></asp:Button>
</p>
<p align="center">
<asp:Button id="btnfour" runat="server"
Text="4"></asp:Button>
<asp:Button id="btnfive" runat="server"
Text="5"></asp:Button>
<asp:Button id="btnsix" runat="server"
Text="6"></asp:Button>
<asp:Button id="multiply" runat="server"
Text="*"></asp:Button>
</p>
<p align="center">
<asp:Button id="btnthree" runat="server"
Text="3"></asp:Button>
<asp:Button id="btntwo" runat="server" Width="15px"
Text="2"></asp:Button>
<asp:Button id="btnone" runat="server"
Text="1"></asp:Button>
<asp:Button id="cmdplus" runat="server"
Text="+"></asp:Button>
</p>
<p dir="ltr" style="MARGIN-RIGHT: 0px" align="center">
<asp:Button id="btnzero" runat="server"
Text="0"></asp:Button>
<asp:Button id="period" runat="server"
Text="."></asp:Button>
<asp:Button id="minus" runat="server"
Text="-"></asp:Button>
<asp:Button id="cmdequal" runat="server"
Text="="></asp:Button>
</p>
<!-- Insert content here -->
</form>
</body>
</html>
conspawn Guest
-
love calculator in PHP
If anyone would like the source code to my love calculator, I will e-mail it to them. The algorithm is very easy to change. Demo is at... -
need help with rate calculator
I have to create an online quote system for my cousin's disco. His rates changedepending on the hour and I need the price calculator to reflect that... -
Calculator malfunctions
I have a new Compaq EVO D310 P4, .99GB RAM, with WinXP Pro (incl SP1) installed. The calc.exe file is acting buggy for me. I use it many times a... -
Interactive Calculator
My business has asked me to develop an online interactive calculator. It would work with 4 or 5 inter-dependent variables to give results. e.g.,... -
Calculator Gone
I upgraded to Windows XP Professional a few weeks ago and I cannot seem to find the calculator at all. Does anyone know where I could download... -
Scott M. #2
Re: NEED HELP WITH CALCULATOR WEB SERVICE
Did you want to tell us exactly what "difficulties" you were having?
"conspawn" <conspawn@aol.com> wrote in message
news:1116962199.400691.320770@g49g2000cwa.googlegr oups.com...> Whats up guys, i am having difficulties coding the plus sign button on
> my aspx page to store variable1, clear textbox, and store variable2
> then call a web service to add both variables
>
> my code so far is:
> <%@ Page Language="VB" %>
> <%@ import Namespace="WebSCalculator" %>
> <script runat="server">
>
> Private Sub btnZero_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btnzero.Click
>
> txtDisplay.Text = txtDisplay.Text & btnzero.Text
>
>
> End Sub
>
> Private Sub btnone_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btnone.Click
>
> txtDisplay.Text = txtDisplay.Text & btnone.Text
>
> End Sub
>
> Private Sub btntwo_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btntwo.Click
>
> txtDisplay.Text = txtDisplay.Text & btntwo.Text
>
> End Sub
>
> Private Sub btnthree_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btnthree.Click
>
> txtDisplay.Text = txtDisplay.Text & btnthree.Text
>
> End Sub
>
> Private Sub btnfour_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btnfour.Click
>
> txtDisplay.Text = txtDisplay.Text & btnfour.Text
>
> End Sub
>
> Private Sub btnfive_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btnfive.Click
>
> txtDisplay.Text = txtDisplay.Text & btnfive.Text
>
> End Sub
>
>
>
> Private Sub btnsix_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btnsix.Click
>
> txtDisplay.Text = txtDisplay.Text & btnsix.Text
>
> End Sub
>
> Private Sub btnseven_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btnseven.Click
>
> txtDisplay.Text = txtDisplay.Text & btnseven.Text
>
> End Sub
>
> Private Sub btneight_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btneight.Click
>
> txtDisplay.Text = txtDisplay.Text & btneight.Text
>
> End Sub
>
> Private Sub btnnine_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles btnnine.Click
>
> txtDisplay.Text = txtDisplay.Text & btnnine.Text
>
> End Sub
>
> Private Sub cmdclear_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles cmdclear.Click
>
> txtDisplay.Text = ""
>
> End Sub
> Private Sub period_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles period.Click
>
> txtDisplay.Text = txtDisplay.Text +"."
>
> End Sub
>
>
>
>
> Private Sub cmdPlus_Click(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) _
> Handles cmdPlus.Click
> Dim Number1 as Double
> Dim Number2 as Double
> number1 = 0
> Number2 = 0
> number1 = number1 & txtdisplay.text
> txtdisplay.text = ""
>
>
>
>
> End Sub
>
> </script>
> <html>
> <head>
> </head>
> <body>
> <form runat="server">
> <p align="center">
> <asp:TextBox id="Txtdisplay" runat="server"></asp:TextBox>
> </p>
> <p align="center">
> <asp:Button id="btnseven" runat="server" Width="15px"
> Text="7"></asp:Button>
> <asp:Button id="btneight" runat="server"
> Text="8"></asp:Button>
> <asp:Button id="btnnine" runat="server"
> Text="9"></asp:Button>
> <asp:Button id="divide" runat="server"
> Text="/"></asp:Button>
> <asp:Button id="cmdclear" runat="server"
> Text="c"></asp:Button>
> </p>
> <p align="center">
> <asp:Button id="btnfour" runat="server"
> Text="4"></asp:Button>
> <asp:Button id="btnfive" runat="server"
> Text="5"></asp:Button>
> <asp:Button id="btnsix" runat="server"
> Text="6"></asp:Button>
> <asp:Button id="multiply" runat="server"
> Text="*"></asp:Button>
> </p>
> <p align="center">
> <asp:Button id="btnthree" runat="server"
> Text="3"></asp:Button>
> <asp:Button id="btntwo" runat="server" Width="15px"
> Text="2"></asp:Button>
> <asp:Button id="btnone" runat="server"
> Text="1"></asp:Button>
> <asp:Button id="cmdplus" runat="server"
> Text="+"></asp:Button>
> </p>
> <p dir="ltr" style="MARGIN-RIGHT: 0px" align="center">
> <asp:Button id="btnzero" runat="server"
> Text="0"></asp:Button>
> <asp:Button id="period" runat="server"
> Text="."></asp:Button>
> <asp:Button id="minus" runat="server"
> Text="-"></asp:Button>
> <asp:Button id="cmdequal" runat="server"
> Text="="></asp:Button>
> </p>
> <!-- Insert content here -->
> </form>
> </body>
> </html>
>
Scott M. Guest
-
conspawn #3
Re: NEED HELP WITH CALCULATOR WEB SERVICE
yea how to code the plus button
i know it has to be something like this where am i going wrong?
Private Sub cmdPlus_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles cmdPlus.Click
Dim Number1 as Double
Dim Number2 as Double
dim MyService as New WebSCalculator.Calculator
If Session("Number1Entered") = "Y" then
Session("Number2") = txtdisplay.text
Session("Number1") =
System.Convert.ToString(MyService.Add(System.Conve rt.ToDouble(number1),system.Convert.ToDouble(numbe r2))
)'Call your web method as it returns a double value back
Session("Number2") = ""
Session("Number1Entered") = "Y"
txtdisplay.text = Session("Number1") ' Show the answer returned
from your web method
End if
Session("Number1") = txtdisplay.text
Session("Number1Entered") = "Y"
Session("Number2") = ""
txtdisplay.text = Session("Number2") ' Clear the display so user
can enter number 2
End Sub
conspawn Guest



Reply With Quote

