Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 9th, 2013, 09:49 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Basic addition button

I am new to programming in general but not IT. I understand pseudo code and I think that I understand the logic behind programming, but have not really written code before. I have worked all the way upto chapter 16 so far, but I am still struggling with the basics. I have gone back and reread chapter 5 since this is the cahpter on programming asp.net pages. I am trying to create a page that has 2 input fields (textboxes) and 4 buttons add subtract mult and div. with a result label.

I have been looking at this problem for 2 days and I am stumped. I have written it 12 different ways but I cannot get the code to work and now I have totally confused myself! Please any help is appreciated!
Reply With Quote
  #2 (permalink)  
Old April 10th, 2013, 02:20 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Can you post your current code as well as a description of what you're having problems with?

If you post code, can you please paste it in Notepad first to remove color coding and then use the forum editor's Code toolbar button to wrap your code in code tags. Otherwise, this forum messes up the code.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Headstrong2112 (April 10th, 2013)
  #3 (permalink)  
Old April 10th, 2013, 09:02 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Basic addition code

Imar,
Thanks for the reply, i actually was able to get it resolved; however I am sure that I will need some more guidance in the the future. Below is the code that I am using for the button. By the way I like your book, I think that you have written it well. As I stated I am new to all programming except for a tiny amount of PHP and desk checking. I have learned a lot so far.

Code:
Protected Sub btnAdd_Click(sender As Object, e As System.EventArgs) Handles btnAdd.Click
        Dim excalc As New CalculatorASS2()
        Dim value1 As Integer = Convert.ToDouble(valueBox1.Text)
        Dim value2 As Integer = Convert.ToDouble(valueBox2.Text)
        Dim result As Integer = excalc.add(value1, value2)

        Label5.Text = result


' this is my public class

Public Class CalculatorASS2
    Public Function add(ByVal a As Double, ByVal b As Double) As Double
        Return a + b
    End Function

    Public Function Subtract(ByVal a As Double, ByVal b As Double) As Double
        Return a - b
    End Function

    Public Function Multipy(ByVal a As Double, ByVal b As Double) As Double
        Return a * b
    End Function

    Public Function Divide(ByVal a As Double, ByVal b As Double) As Double
        Return a / b
    End Function
    Public Function Exponent(ByVal a As Double, ByVal b As Double) As Double
        Return a ^ b
    End Function
End Class

Last edited by Headstrong2112; April 10th, 2013 at 09:08 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual basic activate a button on a web page tonyau Visual Basic 2010 General Discussion 0 November 25th, 2012 08:15 PM
Visual Basic 2010 - Click a button on a website jd29 .NET 4 and Visual Studio 2010 General Discussions 7 September 28th, 2012 03:27 PM
addition to errata luciano991 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 August 25th, 2006 08:29 PM
basic addition to php Adam H-W Beginning PHP 3 July 10th, 2006 09:58 AM



All times are GMT -4. The time now is 01:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.