Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
I get compiler error BC30024 due to Option Explicit
Old 06-13-2008, 03:49 AM I get compiler error BC30024 due to Option Explicit
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
This is just so odd, I decided to start working with ASP today and installed IIS7 on my local machine, when I started going though the tutorial I have I get an error as follows, and when I remove Option Explicit it gets fixed.
Code:
C:\inetpub\wwwroot\index.aspx(2) : error BC30024: Statement is not valid inside a method.

  Option Explicit
  ~~~~~~
My entire code is:
Code:
<%@ Language="VBScript"%>
<%Option Explicit%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>ArenAsp Experiment</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<% response.write("<p>Test</p>")%>
</body>
</html>
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
 
Register now for full access!
Old 06-13-2008, 02:42 PM Re: I get compiler error BC30024 due to Option Explicit
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
<% Option explicit%> HAS to be the first code on the page
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-13-2008, 05:20 PM Re: I get compiler error BC30024 due to Option Explicit
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
I moved it to the top but still get the same error.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-13-2008, 06:00 PM Re: I get compiler error BC30024 due to Option Explicit
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Try using the code behind model, instead of interspersing it in the markup?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 06-13-2008, 06:01 PM Re: I get compiler error BC30024 due to Option Explicit
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
ah compiler error. which would be a .net error

so are you trying to learn ASP & VBScript or Vb.net?

if it is .net, the first line should look like ->

Code:
 <%@ Page Language="VB" Explicit="True"%>
though my .net knowledge is somewhat limited 'cos I really haven't found a really good reason to abandon several years of libraries as yet.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-13-2008, 07:13 PM Re: I get compiler error BC30024 due to Option Explicit
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
Thanks, that sorted it out and yep ASP.net, best I go find a better tutorial it would seem.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-13-2008, 08:38 PM Re: I get compiler error BC30024 due to Option Explicit
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Quote:
Originally Posted by chrishirst View Post
though my .net knowledge is somewhat limited 'cos I really haven't found a really good reason to abandon several years of libraries as yet.
Compilation would be a pretty good reason. But then I haven't really found a good reason to stop rubbing sticks together to make fire, or painting on the walls of my cave to express myself.

The vast amount of time and effort that must have gone into developing an ASP user upload engine could have instead been

Code:
<asp:FileUpload ID="FileUpload1" runat="server" />
It seems like most of the questions I see about ASP are solved this easily in ASP.NET. I think the main difference comes down to whether a person wants to spend their time coding plumbing that adds no value, or whether they'd like to spend their time using modern plumbing to write a solution to a problem.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I get compiler error BC30024 due to Option Explicit
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25260 seconds with 12 queries