View Single Post
  #1 (permalink)  
Old Jan 8th, 2008, 19:48
skat skat is offline
Junior Member
Join Date: Dec 2007
Location: UK
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
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?

PHP: Select all

Partial Class WebApplication3.WebForm1
Inherits System
.Web.UI.Page
 
Sub Calculation
(ByVal Src As ObjectByVal 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 

Last edited by Daniel; Jan 9th, 2008 at 12:39. Reason: please use [code] or [php] when posting code.
Reply With Quote