473,472 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

BC30081: 'If' must end with a matching 'End If'.

The script below runs correctly in ASP but not ASPX. Im not sure why?
Please help.

Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30081: 'If' must end with a matching 'End If'.

Source Error:

Line 3: 'Written by David Addison 207-347-7360
Line 4: 'Set Session ID for each visitor to the site.
Line 5: if Request.Cookies("SID") = "" then
Line 6: if Session("SID") = "" then
Line 7: Function CreateGUID()
<%
'Set Session ID for each visitor to the site.
if Request.Cookies("SID") = "" then
if Session("SID") = "" then
Function CreateGUID()
Dim oTypeLib, sGUID
set oTypeLib = Server.CreateObject("Scriptlet.Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookies("SID")=CreateGUID
Response.Cookies("SID").Expires = Date + 365
Session("SID") = CreateGUID
end if
end if
if Request.Cookies("SID") <> "" then
if Session("SID") = "" then
Session("SID") = Request.Cookies("SID")
end if
end if
if Session("SID") <> "" then
if Request.Cookies("SID") = "" then
Response.Cookies("SID") = Session("SID")
Response.Cookies("SID").Expires = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id")) < 1 then
if LEN(Request.QueryString("id")) <> 0 then
if LEN(Request.Cookies("id")) < 1 then
Session("id") = Request.QueryString("id")
Response.Cookies("id")=Request.QueryString("id")
Response.Cookies("id").Expires = Date + 365
Session("keywords") = Request.QueryString("keywords")
Response.Cookies("keywords")=Request.QueryString(" keywords")
Response.Cookies("keywords").Expires = Date + 365
Session("campaignno") = Request.QueryString("campaignno")
Response.Cookies("campaignno")=Request.QueryString ("campaignno")
Response.Cookies("campaignno").Expires = Date + 365
Session("adgroup") = Request.QueryString("adgroup")
Response.Cookies("adgroup")=Request.QueryString("a dgroup")
Response.Cookies("adgroup").Expires = Date + 365
end if
end if
end if
if LEN(Request.Cookies("id")) <> 0 then
Session("id") = Request.Cookies("id")
Session("keywords") = Request.Cookies("keywords")
Session("campaignno") = Request.Cookies("campaignno")
Session("adgroup") = Request.Cookies("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured with
order.
if LEN(Session("referer")) < 1 then
Session("referer") = Request.ServerVariables("HTTP_REFERER")
Session("scriptname") = Request.ServerVariables("SCRIPT_NAME")
Session("useragent") = Request.ServerVariables("HTTP_USER_AGENT")
Session("remotehost") = Request.ServerVariables("REMOTE_HOST")
end if
%>
Nov 19 '05 #1
2 4757
You cannot declare a function inside an if statement (orinside another
function for that matter). You should probably review OO basics.

Jason Lind

"William" wrote:
The script below runs correctly in ASP but not ASPX. Im not sure why?
Please help.

Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30081: 'If' must end with a matching 'End If'.

Source Error:

Line 3: 'Written by David Addison 207-347-7360
Line 4: 'Set Session ID for each visitor to the site.
Line 5: if Request.Cookies("SID") = "" then
Line 6: if Session("SID") = "" then
Line 7: Function CreateGUID()
<%
'Set Session ID for each visitor to the site.
if Request.Cookies("SID") = "" then
if Session("SID") = "" then
Function CreateGUID()
Dim oTypeLib, sGUID
set oTypeLib = Server.CreateObject("Scriptlet.Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookies("SID")=CreateGUID
Response.Cookies("SID").Expires = Date + 365
Session("SID") = CreateGUID
end if
end if
if Request.Cookies("SID") <> "" then
if Session("SID") = "" then
Session("SID") = Request.Cookies("SID")
end if
end if
if Session("SID") <> "" then
if Request.Cookies("SID") = "" then
Response.Cookies("SID") = Session("SID")
Response.Cookies("SID").Expires = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id")) < 1 then
if LEN(Request.QueryString("id")) <> 0 then
if LEN(Request.Cookies("id")) < 1 then
Session("id") = Request.QueryString("id")
Response.Cookies("id")=Request.QueryString("id")
Response.Cookies("id").Expires = Date + 365
Session("keywords") = Request.QueryString("keywords")
Response.Cookies("keywords")=Request.QueryString(" keywords")
Response.Cookies("keywords").Expires = Date + 365
Session("campaignno") = Request.QueryString("campaignno")
Response.Cookies("campaignno")=Request.QueryString ("campaignno")
Response.Cookies("campaignno").Expires = Date + 365
Session("adgroup") = Request.QueryString("adgroup")
Response.Cookies("adgroup")=Request.QueryString("a dgroup")
Response.Cookies("adgroup").Expires = Date + 365
end if
end if
end if
if LEN(Request.Cookies("id")) <> 0 then
Session("id") = Request.Cookies("id")
Session("keywords") = Request.Cookies("keywords")
Session("campaignno") = Request.Cookies("campaignno")
Session("adgroup") = Request.Cookies("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured with
order.
if LEN(Session("referer")) < 1 then
Session("referer") = Request.ServerVariables("HTTP_REFERER")
Session("scriptname") = Request.ServerVariables("SCRIPT_NAME")
Session("useragent") = Request.ServerVariables("HTTP_USER_AGENT")
Session("remotehost") = Request.ServerVariables("REMOTE_HOST")
end if
%>

Nov 19 '05 #2
> You should probably review OO basics.

Heck, Jason, that isn't even OO basics! It's plain programming basics!
Perhaps he's used to ActionScript, which seems to play fast and loose with
those sorts of rules.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"Jason L Lind" <Ja********@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
You cannot declare a function inside an if statement (orinside another
function for that matter). You should probably review OO basics.

Jason Lind

"William" wrote:
The script below runs correctly in ASP but not ASPX. Im not sure why?
Please help.

Description: An error occurred during the compilation of a resource
required
to service this request. Please review the following specific error
details
and modify your source code appropriately.

Compiler Error Message: BC30081: 'If' must end with a matching 'End If'.

Source Error:

Line 3: 'Written by David Addison 207-347-7360
Line 4: 'Set Session ID for each visitor to the site.
Line 5: if Request.Cookies("SID") = "" then
Line 6: if Session("SID") = "" then
Line 7: Function CreateGUID()
<%
'Set Session ID for each visitor to the site.
if Request.Cookies("SID") = "" then
if Session("SID") = "" then
Function CreateGUID()
Dim oTypeLib, sGUID
set oTypeLib = Server.CreateObject("Scriptlet.Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookies("SID")=CreateGUID
Response.Cookies("SID").Expires = Date + 365
Session("SID") = CreateGUID
end if
end if
if Request.Cookies("SID") <> "" then
if Session("SID") = "" then
Session("SID") = Request.Cookies("SID")
end if
end if
if Session("SID") <> "" then
if Request.Cookies("SID") = "" then
Response.Cookies("SID") = Session("SID")
Response.Cookies("SID").Expires = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id")) < 1 then
if LEN(Request.QueryString("id")) <> 0 then
if LEN(Request.Cookies("id")) < 1 then
Session("id") = Request.QueryString("id")
Response.Cookies("id")=Request.QueryString("id")
Response.Cookies("id").Expires = Date + 365
Session("keywords") = Request.QueryString("keywords")
Response.Cookies("keywords")=Request.QueryString(" keywords")
Response.Cookies("keywords").Expires = Date + 365
Session("campaignno") = Request.QueryString("campaignno")
Response.Cookies("campaignno")=Request.QueryString ("campaignno")
Response.Cookies("campaignno").Expires = Date + 365
Session("adgroup") = Request.QueryString("adgroup")
Response.Cookies("adgroup")=Request.QueryString("a dgroup")
Response.Cookies("adgroup").Expires = Date + 365
end if
end if
end if
if LEN(Request.Cookies("id")) <> 0 then
Session("id") = Request.Cookies("id")
Session("keywords") = Request.Cookies("keywords")
Session("campaignno") = Request.Cookies("campaignno")
Session("adgroup") = Request.Cookies("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured
with
order.
if LEN(Session("referer")) < 1 then
Session("referer") = Request.ServerVariables("HTTP_REFERER")
Session("scriptname") = Request.ServerVariables("SCRIPT_NAME")
Session("useragent") = Request.ServerVariables("HTTP_USER_AGENT")
Session("remotehost") = Request.ServerVariables("REMOTE_HOST")
end if
%>

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Greg Lindstrom | last post by:
Hello- I'm running Python 2.2.3 on Windows XP "Professional" and am reading a file wit 1 very long line of text (the line consists of multiple records with no cr/lf). What I would like to do is...
17
by: Andrew McLean | last post by:
I have a problem that is suspect isn't unusual and I'm looking to see if there is any code available to help. I've Googled without success. Basically, I have two databases containing lists of...
2
by: laurenq uantrell | last post by:
IS there a way to combine all matching rows in a table so that it outputs as one row, for example: tblMyStuff UniqueID int IDENTITY ParentID int SomeSuch nvarchar(50) SomeSuch2 nvarchar(50) ...
1
by: David C. Barber | last post by:
I'm trying to determine if any matching records exist on a LIKE query performing a partial match of last names to a remote back-end database in the most efficient manner possible. LAN Traffic...
59
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
4
by: zlj0000 | last post by:
//迷宫问题 #include<stdio.h> #include<malloc.h> #define sqstack S #define STACK_INIT_SIZE 100 #define STACKINCREMENT 10 struct zuobiao{ int i;
1
by: solarin | last post by:
Hi, I've developed a program under VS 6.0. I can compile it and run it, but when I try to debbug , all my breakpoints are dissabled and I can see the following messages: Loaded...
11
by: tech | last post by:
Hi, I need a function to specify a match pattern including using wildcard characters as below to find chars in a std::string. The match pattern can contain the wildcard characters "*" and "?",...
1
by: sora | last post by:
Hi, I've developed a MFC program under VS 6.0. My debugger *was* working fine and I've used it often for my project. Then, one day, the errors below appear and they prevent me from using the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.