Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Programming > Server-Side Scripting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-08-2008, 03:47 PM
Junior Member
 
Join Date: Dec 2007
Posts: 24
Default code behind code doesnt work

i have created a seperate file to put some code behind code in in asp.net with vb application.
however, when i run my code it doesnt work, there are 3 errors which occur.
the first being it says the first line a declaration is expected, in lines 2 and 4 it says the stament is not in a valid namespace and finally, it says for the last line that the end class must be preceeded by a matching class. i have pasted my code underneath, can someone please advise me, especially about the namespace bit. i run my application locally, i do not have a web server, do you think this is causing any problems?

Partial Class WebApplication3.WebForm1
Inherits System.Web.UI.Page

Sub Calculation(ByVal Src As Object, ByVal Args As EventArgs)

Dim cost As Double
Dim total As Double
Dim quantity As Double

If (FruitDropDown.SelectedValue = "Apples") Then
cost = 2
End If
If (FruitDropDown.SelectedValue = "Bananas") Then
cost = 3
End If
If (FruitDropDown.SelectedValue = "Cherries") Then
cost = 5
End If

quantity = CDbl(TextBox.Text)

total = cost * quantity

CostCalculationLabel.Text = quantity.ToString + " " + FruitDropDown.SelectedValue + " will cost " + total.ToString

End Sub

End Class
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
sometimes a link wont work.. why? cvsouth HTML/CSS 5 01-19-2008 09:39 PM
Getting php code in the colors like dreamweaver FireFoxtrot Server-Side Scripting 5 12-08-2007 07:35 PM
Java script code problem sarah Server-Side Scripting 1 05-01-2006 11:25 PM
Java script code problem sarah Forum Members Lounge 0 04-12-2006 09:08 PM


All times are GMT -5. The time now is 02:18 AM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.