problem with ASP classic conversion to .NET

J

jason

i'm working on a gradual conversion of an ASP classic web site to
ASP.NET. a recent body of work involves adding a new asp page to the
existing site. i thought this would be a good opportunity to try this
"in place" conversion capability that .NET boasts.

the new aspx file, in order to function, will require many includes
from other ASP classic files. it was my impression that ASP.NET and ASP
classic would play well together in the same file, though? if this is
true, can some one tell me what causes the following error?

code from "functions.asp":

pathvariable = "/mypath/default.asp"

If rcdatabasetype = "MS SQL" Then
rctrue = 1
rcfalse = 0
Else
rctrue = True
rcfalse = False
End If

Function SQLFix(strSQL)
If Trim(strSQL) = "" Then
SQLFix = NULL
Else
SQLFix = Trim(strSQL)
End Function
End Function

code from the top of "testaspx.aspx":

<%@ Page Language="vb" ContentType="text/html"
ResponseEncoding="iso-8859-1" CodeBehind="mycart.aspx.vb"
AutoEventWireup="false" Inherits="rentclicks.dev.mycart" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html>
<!-- InstanceBegin template="/Templates/dotnet.dwt.aspx"
codeOutsideHTMLIsLocked="false" -->
<head>
<% Response.Buffer = True %>
<!--#include virtual="/pathstuff/constants.asp"-->
<!--#include virtual="/pathstuff/functions.asp"-->

but the compiler doesn't get past that bottom line of testaspx.aspx,
because it reports the following error when trying to compile
functions.asp (constants.asp is nothing but variable name declarations,
which is why i left it out of this question):

Compiler Error Message: BC30289: Statement cannot appear within a
method body. End of method assumed.

Source Error:

Line 10: End If
Line 11:
*Line 12: Function SQLFix(strSQL)
Line 13: If Trim(strSQL) = "" Then
Line 14: SQLFix = NULL


Source File:

C:\Inetpub\wwwroot\jason.rentclicks.dev\classifieds\utilities\functions.asp
Line: 12

this inclusion works just fine in the other 60 ASP classic pages on the
website. can someone point me in the right direction to figure out why
including the same files in an aspx file would fail?

thanks in advance,

jason
 
A

Alvin Bruney [MVP - ASP.NET]

not in the same file because the webserver serves pages on page extensions,
there fore you can't have both. Either or.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,795
Messages
2,569,644
Members
45,358
Latest member
TreyTritt8

Latest Threads

Top