prowla2003 Posted June 18, 2003 Posted June 18, 2003 I'm trying to convert asp straight to aspx with minimal changes to the original asp file... the asp file has an include file... and the specific problem i have is when i compile the page i get "Compiler Error Message: BC30188: Declaration expected." on the line str = "HELLOEESDFA" which is inside the include file. can anyone offer an explanation?? <script language="VBScript" runat="server"> dim str str = "HELLOEESDFA" function HelloWorld(str) HelloWorld = "Hello " & str end function </script> <%@ Page Language="vb" AutoEventWireup="false" Codebehind="test4.aspx.vb" Inherits="test4"%> <!-- #include file="../serverscripts/test.asp" --> <HTML> <HEAD> <title>test4</title> <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0"> <meta name="CODE_LANGUAGE" content="Visual Basic 7.0"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body> <form id="Form1" method="post" runat="server"> </form> </body> </HTML> Quote
*Gurus* Derek Stone Posted June 18, 2003 *Gurus* Posted June 18, 2003 You should be using Visual Basic .NET, not VBScript. <script runat="server"> Dim s As String Sub Page_Load(sender As Object, e As EventArgs) s = "HELLOEESDFA" End Sub 'Page_Load Function HelloWorld(text As String) As String Return "Hellow " & text End Function 'HelloWorld </script> Quote Posting Guidelines
iebidan Posted June 18, 2003 Posted June 18, 2003 Things changed in .NET for ASPX... better read about it before doing any upgrade, took me a lot of time to upgrade an ASP app I had to ASPX, you can find a lot of information on the MSDN Library Quote Fat kids are harder to kidnap
hrabia Posted June 19, 2003 Posted June 19, 2003 For dim str str = "HELLOEESDFA" you cannot use <script> tag. You have to use <% %>. Quote A man and a dog have an average of three legs. Beaware of Statistics.
prowla2003 Posted June 19, 2003 Author Posted June 19, 2003 (edited) so to get this right... if i have an existing asp include file with the following code excerpt <% dim gStr gStr = "HELLO" function Hello() 'dosomething end function %> i cannot just use it in an aspx without taking out lines that instantiate variables ie gStr = "HELLO" (ps. thanx for all the replies) Edited June 19, 2003 by prowla2003 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.