Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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>

  • *Gurus*
Posted

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>

Posted
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
Fat kids are harder to kidnap
Posted

For

 

dim str

str = "HELLOEESDFA"

 

you cannot use <script> tag. You have to use <% %>.

A man and a dog have an average of three legs.

Beaware of Statistics.

Posted (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 by prowla2003

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...