Web Design and Development Forums

code behind code doesnt work

This is a discussion on "code behind code doesnt work" within the ASP.NET Forum section. This forum, and the thread "code behind code doesnt work are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > ASP.NET Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Jan 8th, 2008, 19:48   #1 (permalink)
Junior Member
 
Join Date: Dec 2007
Location: UK
Posts: 25
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.
skat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 9th, 2008, 12:40   #2 (permalink)
Elite Veteran
 
Daniel's Avatar
 
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 21
Posts: 2,381
Blog Entries: 12
Send a message via MSN to Daniel
Re: code behind code doesnt work

code behind code?
__________________
FMFA Manager / World Footy Forums
Daniel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 9th, 2008, 12:48   #3 (permalink)
Elite Veteran
 
karinne's Avatar
 
Join Date: Jan 2007
Location: You know where
Age: 30
Posts: 4,883
Re: code behind code doesnt work

In .NET you put your code in a "code behind" page ... it's automatically created (in VS anyways) so you don't have code with your mark-up
__________________
a web design portfolio | web non-sense
karinne is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 9th, 2008, 12:48   #4 (permalink)
Elite Veteran
 
Daniel's Avatar
 
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 21
Posts: 2,381
Blog Entries: 12
Send a message via MSN to Daniel
Re: code behind code doesnt work

Ohhh thanks.
__________________
FMFA Manager / World Footy Forums
Daniel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Feb 18th, 2008, 10:05   #5 (permalink)
New Member
 
Join Date: Feb 2006
Location: Norwich, UK
Posts: 6
Re: code behind code doesnt work

Can you give me the code from your .vb file too to save me 'mocking up' the page? I'll then have a look for you.
kato77 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
can anyone tell me why this sprtie code doesnt work lostyboy CSS Forum 12 Oct 15th, 2007 14:25
will this code work on its own, please? Gerry Flash & Multimedia Forum 3 Oct 9th, 2007 16:03
Code doesent work on a prevscene - please help!! shamanz Flash & Multimedia Forum 4 Jul 16th, 2007 15:46
live search code and styleswitcher code hebel JavaScript Forum 0 May 12th, 2007 06:16
Can somebody give me the code to hide the source code? renren JavaScript Forum 7 Mar 7th, 2006 12:27



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 21:48.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59