Trying to create a Class with code I already have

mdsmeck

New member
Joined
Feb 9, 2011
Messages
2
Location
Ohio
Programming Experience
Beginner
Newbie learning VB.Net and ASP.Net...

Have the following VB.Net code and I want to create a Class from it, but what I am doing is definitely not working...

Here is the code that works fine:

VB.NET:
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub subButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles subButton.Click
'Define Variables
Dim TuitionRate As Double
Dim TuitionTotal As Double
'Check Radio Button - Residency to detemine Tuition Rate
If RadioButtonList1.SelectedIndex = 0 Then
TuitionRate = 98.8D
ElseIf RadioButtonList1.SelectedIndex = 1 Then
TuitionRate = 119D
Else : TuitionRate = 240.45D
End If
'Check creditHoursTextBox.Text for Credit Hours Entered and Calculate Tution
If creditHoursTextBox.Text <= 13 Then
TuitionTotal = creditHoursTextBox.Text * TuitionRate
ElseIf creditHoursTextBox.Text < 19 Then
TuitionTotal = 13 * TuitionRate
Else : TuitionTotal = ((creditHoursTextBox.Text - 18) * TuitionRate + (TuitionRate * 13))
End If
'Write Out Result Formatted for Currency
lblTuition.Text = TuitionTotal.ToString("C2")
End Sub
End Class

Input is based on the user selecting a radio button to determine the TuitionRate and enters the number of credit hours in a textbox...

I need to turn this into a Class now and am just not getting it...

Any help would be greatly appreciated...

Thanks In Advance...
 
Back
Top