converting asp to aspx

prowla2003

Member
Joined
Jun 18, 2003
Messages
10
Im 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>
 
You should be using Visual Basic .NET, not VBScript.

Code:
<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>
 
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
 
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)
 
Last edited by a moderator:
Back
Top