473,673 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

If must end with a matching End It

Does anyone know what is causing the error below. The following scipt runs
in .asp but not .aspx??? 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'.

<%
'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.CreateOb ject("Scriptlet .Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookie s("SID")=Create GUID
Response.Cookie s("SID").Expire s = 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.Cookie s("SID") = Session("SID")
Response.Cookie s("SID").Expire s = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id ")) < 1 then
if LEN(Request.Que ryString("id")) <> 0 then
if LEN(Request.Coo kies("id")) < 1 then
Session("id") = Request.QuerySt ring("id")
Response.Cookie s("id")=Request .QueryString("i d")
Response.Cookie s("id").Expir es = Date + 365
Session("keywor ds") = Request.QuerySt ring("keywords" )
Response.Cookie s("keywords")=R equest.QueryStr ing("keywords")
Response.Cookie s("keywords").E xpires = Date + 365
Session("campai gnno") = Request.QuerySt ring("campaignn o")
Response.Cookie s("campaignno") =Request.QueryS tring("campaign no")
Response.Cookie s("campaignno") .Expires = Date + 365
Session("adgrou p") = Request.QuerySt ring("adgroup")
Response.Cookie s("adgroup")=Re quest.QueryStri ng("adgroup")
Response.Cookie s("adgroup").Ex pires = Date + 365
end if
end if
end if
if LEN(Request.Coo kies("id")) <> 0 then
Session("id") = Request.Cookies ("id")
Session("keywor ds") = Request.Cookies ("keywords")
Session("campai gnno") = Request.Cookies ("campaignno ")
Session("adgrou p") = Request.Cookies ("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured with
order.
if LEN(Session("re ferer")) < 1 then
Session("refere r") = Request.ServerV ariables("HTTP_ REFERER")
Session("script name") = Request.ServerV ariables("SCRIP T_NAME")
Session("userag ent") = Request.ServerV ariables("HTTP_ USER_AGENT")
Session("remote host") = Request.ServerV ariables("REMOT E_HOST")
end if
%>

Nov 21 '05 #1
4 4040
Even in ASP, you really shouldn't put global code (i.e. function, sub,
class) inside an if-then block.Since I used code-behind, I don't know if it
is even allowed in ASP.Net.

--
Jonathan Allen
"William" <da@northernit. net> wrote in message
news:B_******** ******@twister. nyroc.rr.com...
Does anyone know what is causing the error below. The following scipt
runs
in .asp but not .aspx??? 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'.

<%
'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.CreateOb ject("Scriptlet .Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookie s("SID")=Create GUID
Response.Cookie s("SID").Expire s = 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.Cookie s("SID") = Session("SID")
Response.Cookie s("SID").Expire s = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id ")) < 1 then
if LEN(Request.Que ryString("id")) <> 0 then
if LEN(Request.Coo kies("id")) < 1 then
Session("id") = Request.QuerySt ring("id")
Response.Cookie s("id")=Request .QueryString("i d")
Response.Cookie s("id").Expir es = Date + 365
Session("keywor ds") = Request.QuerySt ring("keywords" )
Response.Cookie s("keywords")=R equest.QueryStr ing("keywords")
Response.Cookie s("keywords").E xpires = Date + 365
Session("campai gnno") = Request.QuerySt ring("campaignn o")
Response.Cookie s("campaignno") =Request.QueryS tring("campaign no")
Response.Cookie s("campaignno") .Expires = Date + 365
Session("adgrou p") = Request.QuerySt ring("adgroup")
Response.Cookie s("adgroup")=Re quest.QueryStri ng("adgroup")
Response.Cookie s("adgroup").Ex pires = Date + 365
end if
end if
end if
if LEN(Request.Coo kies("id")) <> 0 then
Session("id") = Request.Cookies ("id")
Session("keywor ds") = Request.Cookies ("keywords")
Session("campai gnno") = Request.Cookies ("campaignno ")
Session("adgrou p") = Request.Cookies ("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured
with
order.
if LEN(Session("re ferer")) < 1 then
Session("refere r") = Request.ServerV ariables("HTTP_ REFERER")
Session("script name") = Request.ServerV ariables("SCRIP T_NAME")
Session("userag ent") = Request.ServerV ariables("HTTP_ USER_AGENT")
Session("remote host") = Request.ServerV ariables("REMOT E_HOST")
end if
%>

Nov 21 '05 #2
William,

When this runs in ASP, than it is in my opinion a bug that you are using.
This is in not in anyway right coding.

Just my thought,

Cor
Nov 21 '05 #3
I don't see the bug. Suggestion: try removing each of the IF blocks until
the code compiles correctly. The last one you removed is the offending one.
Then add it back in and remove the contents, leaving only the conditionals.
If it compiles, then the problem is in the body.

One thing to look for: are you using a double-quote from ASCII and a
double-quote from another character set?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"William" <da@northernit. net> wrote in message
news:B_******** ******@twister. nyroc.rr.com...
Does anyone know what is causing the error below. The following scipt
runs
in .asp but not .aspx??? 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'.

<%
'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.CreateOb ject("Scriptlet .Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookie s("SID")=Create GUID
Response.Cookie s("SID").Expire s = 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.Cookie s("SID") = Session("SID")
Response.Cookie s("SID").Expire s = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id ")) < 1 then
if LEN(Request.Que ryString("id")) <> 0 then
if LEN(Request.Coo kies("id")) < 1 then
Session("id") = Request.QuerySt ring("id")
Response.Cookie s("id")=Request .QueryString("i d")
Response.Cookie s("id").Expir es = Date + 365
Session("keywor ds") = Request.QuerySt ring("keywords" )
Response.Cookie s("keywords")=R equest.QueryStr ing("keywords")
Response.Cookie s("keywords").E xpires = Date + 365
Session("campai gnno") = Request.QuerySt ring("campaignn o")
Response.Cookie s("campaignno") =Request.QueryS tring("campaign no")
Response.Cookie s("campaignno") .Expires = Date + 365
Session("adgrou p") = Request.QuerySt ring("adgroup")
Response.Cookie s("adgroup")=Re quest.QueryStri ng("adgroup")
Response.Cookie s("adgroup").Ex pires = Date + 365
end if
end if
end if
if LEN(Request.Coo kies("id")) <> 0 then
Session("id") = Request.Cookies ("id")
Session("keywor ds") = Request.Cookies ("keywords")
Session("campai gnno") = Request.Cookies ("campaignno ")
Session("adgrou p") = Request.Cookies ("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured
with
order.
if LEN(Session("re ferer")) < 1 then
Session("refere r") = Request.ServerV ariables("HTTP_ REFERER")
Session("script name") = Request.ServerV ariables("SCRIP T_NAME")
Session("userag ent") = Request.ServerV ariables("HTTP_ USER_AGENT")
Session("remote host") = Request.ServerV ariables("REMOT E_HOST")
end if
%>

Nov 21 '05 #4
I would suspect that the inbedded function is confusing the compiler - try
removing it and see it compiles. If so, then engineer the function external
to the main global code (as suggested previously).

Regards
Simon
"William" <da@northernit. net> wrote in message
news:B_******** ******@twister. nyroc.rr.com...
Does anyone know what is causing the error below. The following scipt
runs
in .asp but not .aspx??? 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'.

<%
'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.CreateOb ject("Scriptlet .Typelib")
sGUID = oTypeLib.GUID
sGUID = LCase(sGUID)
sGUID = Mid(sGUID, 1, Len(sGUID) - 2)
Set oTypeLib = Nothing
CreateGUID = sGUID
End Function
Response.Cookie s("SID")=Create GUID
Response.Cookie s("SID").Expire s = 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.Cookie s("SID") = Session("SID")
Response.Cookie s("SID").Expire s = Date + 365
end if
end if
'Set Tracking Variables for each visitor to the site.
if LEN(session("id ")) < 1 then
if LEN(Request.Que ryString("id")) <> 0 then
if LEN(Request.Coo kies("id")) < 1 then
Session("id") = Request.QuerySt ring("id")
Response.Cookie s("id")=Request .QueryString("i d")
Response.Cookie s("id").Expir es = Date + 365
Session("keywor ds") = Request.QuerySt ring("keywords" )
Response.Cookie s("keywords")=R equest.QueryStr ing("keywords")
Response.Cookie s("keywords").E xpires = Date + 365
Session("campai gnno") = Request.QuerySt ring("campaignn o")
Response.Cookie s("campaignno") =Request.QueryS tring("campaign no")
Response.Cookie s("campaignno") .Expires = Date + 365
Session("adgrou p") = Request.QuerySt ring("adgroup")
Response.Cookie s("adgroup")=Re quest.QueryStri ng("adgroup")
Response.Cookie s("adgroup").Ex pires = Date + 365
end if
end if
end if
if LEN(Request.Coo kies("id")) <> 0 then
Session("id") = Request.Cookies ("id")
Session("keywor ds") = Request.Cookies ("keywords")
Session("campai gnno") = Request.Cookies ("campaignno ")
Session("adgrou p") = Request.Cookies ("adgroup")
end if
'Set session Referring URL, IP, Broswer Type so that it can be captured
with
order.
if LEN(Session("re ferer")) < 1 then
Session("refere r") = Request.ServerV ariables("HTTP_ REFERER")
Session("script name") = Request.ServerV ariables("SCRIP T_NAME")
Session("userag ent") = Request.ServerV ariables("HTTP_ USER_AGENT")
Session("remote host") = Request.ServerV ariables("REMOT E_HOST")
end if
%>

Nov 21 '05 #5

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

Similar topics

8
6977
by: gsv2com | last post by:
One of my weaknesses has always been pattern matching. Something I definitely need to study up on and maybe you guys can give me a pointer here. I'm looking to remove all of this code and just use pattern matching to determine if the proper amount of numeric characters has been met. Here is the function I've already done. Any help you can give in a pattern matching solution would be much appreciated and very educational.
176
8115
by: Thomas Reichelt | last post by:
Moin, short question: is there any language combining the syntax, flexibility and great programming experience of Python with static typing? Is there a project to add static typing to Python? Thank you, -- greetz tom
17
14053
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 postal addresses and need to look for matching addresses in the two databases. More precisely, for each address in database A I want to find a single matching address in database B. I'm 90% of the way there, in the sense that I have a simplistic...
1
2732
by: Henry | last post by:
I have a table that stores a list of zip codes using a varchar column type, and I need to perform some string prefix pattern matching search. Let's say that I have the columns: 94000-1235 94001 94100 If I run a pattern matching search for the string "940", then I should get the top two rows of data back. If I run a pattern matching search for the string "94", then I should get all the three rows of data back.
10
4969
by: bpontius | last post by:
The GES Algorithm A Surprisingly Simple Algorithm for Parallel Pattern Matching "Partially because the best algorithms presented in the literature are difficult to understand and to implement, knowledge of fast and practical algorithms is not commonplace." Hume and Sunday, "Fast String Searching", Software - Practice and Experience, Vol. 21 # 11, pp 1221-48
5
5747
by: olaufr | last post by:
Hi, I'd need to perform simple pattern matching within a string using a list of possible patterns. For example, I want to know if the substring starting at position n matches any of the string I have a list, as below: sentence = "the color is $red" patterns = pos = sentence.find($)
1
6391
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 'D:\prj\simulador HMS\Enviar Datos al sim\CMS\Debug\CMS.exe', no matching symbolic information found. Loaded 'ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic
2
2113
by: santhoshs | last post by:
Hello I am required to parse two files that contain email addresses and figure out a way to get the matching and non-matching email addresses from both the files. I was able to get the matching entries by using the following code: #!/usr/bin/perl open f1,"file1" or die "cannot open file:$!\n"; open f2,"file2" or die "cannot open file2:$!\n"; open out,">match.out" or die $@; @file1=<f1>; @file2 =<f2>; close f1;close f2;
11
4835
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 "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character. Does boost or some other library have this capability? If boost does have this, do i need to include an entire
1
4631
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 debugger. I know that I get these warnings because the OS symbols arn't installed (a few of them loaded fine). As far as I can remember, I didn't touch anything that should mess with the debugger so I don't know how to fix it and I need to be able to...
0
8429
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8957
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8652
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8704
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6266
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4254
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2853
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 we have to send another system
2
2105
muto222
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.