Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 1st, 2006, 04:38 AM
Registered User
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tax

I have shirts and hats and both items have quantity boxes. I need the subtotal before tax and the total after tax. Whenever I run it I get an error in the Total = Registar () line. Could someone please correct my code for me. It's driving me crazy. The sales tax is 8 percent and if 1 shirt and 2 hats were selected when I press the submit button it needs to return the subtotal and total. Thank you!

<title>Sales Tax</title>

<form name="_ctl0" method="post" action="maybe.aspx" id="_ctl0">
<br><span id="Message1">Shirts ($5 each)</span>
<input name="Text1" column="1" type="text" id="Text1" />
<br><span id="Message2">Hats ($10 each)</span>
<input name="Text2" column="1" type="text" id="Text2" />
<INPUT type=submit>
<br>Subtotal: $<span id="Message3">0</span>
<br>Total after tax: $<span id="Message4">0</span>

  <script language="vb" runat="server">

  Sub Page_Load()
     Dim Text1 As Integer
     Dim Text2 As Integer
      Dim Stax As Decimal
      Dim x As Integer
      Dim y As Integer
      Dim Total As Decimal

      Text1 = x * 215.99
    Text2 = y * 30.99
      Stax = .08
      Total = Registar()
      Display1.Text = Total

   End Sub

Function Registar(Total as Integer)

  Total = (Text1 + Text2)(Stax)

End Function


Old February 1st, 2006, 04:45 AM
Registered User
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts

I made an error...

the equations should be as follows:

text1 = x * 5
text2 = y * 10

Hope that helps!

Old February 3rd, 2006, 03:44 PM
Friend of Wrox
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts

You have to pass values as parameters to your funciton registar

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sales Tax RaCheer ASP.NET 1.0 and 1.1 Basics 5 January 31st, 2006 10:54 AM
TAX / VAT Calucating DB crmpicco MySQL 6 September 12th, 2005 10:09 AM
TAX Calculation crmpicco Classic ASP Databases 0 June 8th, 2005 05:42 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.