C
conspawn
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>
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>