What does <% mean? Is it some sort of comment??

M

Mark Parnell

I just encountered a page which displays improperly in Netscape (7.1 and
4.7) - it shows lines staring with <% and ending with %>

That's ASP.
These lines do not display with I.E. 6.

That doesn't make much sense, since ASP is processed on the server,
before it even gets sent to the browser. URL?
 
M

Mark Parnell

That doesn't make much sense, since ASP is processed on the server,
before it even gets sent to the browser. URL?

Duh, didn't see the URL in your original post. Looks like their server
isn't set up correctly. As usual, IE error corrects for them, so they
never even know it isn't working.
 
B

Bob Novell

Mark said:
Duh, didn't see the URL in your original post. Looks like their server
isn't set up correctly. As usual, IE error corrects for them, so they
never even know it isn't working.

I'm going to send them an email and tell them to have their web "guys"
look at it.

Do you suppose that Netscape is treating the <% %> sequence like an HTML
comment?

Hmmm - that's testable - I'll make up a page with those sequences and
see what I.E. does with them.

I made a test file, on my system, containing the line

<% ' Part 2 of the image %>

and looked at it with Netscape 7.1 and I.E. 6

The line appears with Netscape but not with I.E.

Looks like I.E.is treating it as a comment and not displaying it.

I did a bit more testing and I.E. is treating it as a comment - anything
between <% and %> is not displayed and any tags in the sequence are ignored.

Well, so much for MS doing things their way

You are right, anyone making up the pages and testing only withI.E. will
never see the problem.

What does <% mean in ASP?

Bob
 
W

Weyoun the Dancing Borg

Bob said:
What does <% mean in ASP?

Hi Bob.

The <% symbols mean 'begin asp code', they are the ASP equivalent of
<html> When you create an ASP page you usually program in JavaScript or
VisualBasic Script (VBScript). You create a black .asp file and code
with normal HTML. When you want to do something serverside, such as
retrieve some information from a database, you would type <% (code) %>
and then continue with the HMTL code.

An example would look like this:

<td>
<tr> <% (call information from database) %> </tr>
</td>
 
M

Mark Parnell

What does <% mean in ASP?

Anything in between the <% and %> is ASP code. It is written like that
so that the server knows that it needs to process anything between those
tags before sending the page to the browser. In this case, the server is
evidently not set up to process ASP code in .htm files, so it just sends
the page as is. Netscape/Mozilla just sees it as text, so displays it on
the page as such. IE recognises that it shouldn't be there, so hides it.

It's stupid, really, because the single quote ' marks a comment in ASP
anyway. So there isn't actually any code there for the server to
process. It would normally just strip that out.
 
A

Augustus

<% ' Part 2 of the image %>

and looked at it with Netscape 7.1 and I.E. 6

The line appears with Netscape but not with I.E.

Looks like I.E.is treating it as a comment and not displaying it.

I did a bit more testing and I.E. is treating it as a comment - anything
between <% and %> is not displayed and any tags in the sequence are ignored.

Well, so much for MS doing things their way

------------------

Depends how you look at it...

You could look at it that way, or you could look at it like: Here IE is
seeing an unknown tag and is doing the right thing in not displaying it...
while Netscape is taking a tag it doesn't known and foolishly they display
it.
 
J

Jason Henning

Do you suppose that Netscape is treating the <% %> sequence like an HTML
comment?

Hmmm - that's testable - I'll make up a page with those sequences and
see what I.E. does with them.

I made a test file, on my system, containing the line

<% ' Part 2 of the image %>

and looked at it with Netscape 7.1 and I.E. 6

The line appears with Netscape but not with I.E.

Looks like I.E.is treating it as a comment and not displaying it.

I'm sure it's being treated as a bad tag and ignored, not a commnet.
However, both have the same outcome.

Drop a <Jason Henning> in an html page and you'll see it's ignore as
well. I wonder if my wife is browser based?

Cheers,
Jason Henning
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top