"'If' must end with a matching 'End If'."

N

Neo Geshel

It seems that there is somewhere where an IF statement will not nor ever
function inside of an ASP.NET application.

I am using IIS5 on Win2K. I have a web page that uses ASP.NET includes
(an "@ resister" with the "Name:tag"). In the ascx include file I have a
Sub Page_Load that contains an IF statement. I need the Sub Page_Load to
exist inside the ascx file, because its results will be written to
another part of the ascx's contents.

It seems that the IF statement is incapable of functioning, as the
server is claiming that the IF statement has no matching "End If", when
in fact it does. I am using the following code:
If ((Request.Browser.Platform = "WinNT") And
(Request.Browser.Browser = "IE") And (Request.Browser.MajorVersion =
"6")) Then
strBrowserDetect = " <object id=""CTAdjust""
codeBase=""http://www.microsoft.com/typography/clearadj.cab#version=1,0,0,1""
classid=""CLSID:DE22A7AB-A739-4C58-AD52-21F9CD6306B7""
VIEWASTEXT></object>" & vbCrLf & " <script type=""text/javascript""
src=""/js/cleartype.js""></script>" & VbCrLf
End If

It produces the following error message:

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

Source Error:

Line 14: If ((Request.Browser.Platform = "WinNT") And
(Request.Browser.Browser = "IE") And (Request.Browser.MajorVersion =
"6")) Then
Line 15: strBrowserDetect = " <object id=""CTAdjust""
codeBase=""http://www.microsoft.com/typography/clearadj.cab#version=1,0,0,1""
classid=""CLSID:DE22A7AB-A739-4C58-AD52-21F9CD6306B7""
VIEWASTEXT></object>" & vbCrLf & " <script type=""text/javascript""
src=""/js/cleartype.js""></script>" & VbCrLf
Line 16: End If

Source File: C:\Inetpub\Web Sites\Prairie West Wood
Products\www\ssi\head.ascx Line: 14


When I strip everything out of the IF statement, and put the following
in the Sub:
If Request.Browser.Platform = "WinNT" Then
End If

I get the following very bizarre error message:

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

Source Error:

Line 61: #End ExternalSource
Line 62:
Line 63: Public Sub New()
Line 64: MyBase.New
Line 65: If (ASP.head_ascx.__initialized = false) Then

Source File: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary
ASP.NET Files\root\b8f35e90\23891c34\7ycfnybt.0.vb Line: 63



COULD SOMEONE PLEASE TELL ME JUST WHAT THE **** IS GOING ON HERE??

TIA
....Geshel
--
**********************************************************************
My reply-to is an automatically monitored spam honeypot. Do not use it
unless you want to be blacklisted by SpamCop. Please reply to my first
name at my last name dot org.
**********************************************************************
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top