471,084 Members | 782 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,084 software developers and data experts.

Simple if...else asp/html question

Hi

I have only begun to look into ASP due to an assignments requirements
(I usually code in PHP), one feature in PHP is to be able to do an
if...else statement, where if a certain statement is true then a chunk
of HTML can be outputted...

Basically I want to be able to do this in ASP to use with a simple
authentication system which I will construct.

I have just got a fat book on ASP, and am beginning to read through it
etc

Regards

Lawrence

Apr 26 '07 #1
2 8641

"Lawrence" <la***********@gmail.comwrote in message
news:11**********************@r30g2000prh.googlegr oups.com...
Hi

I have only begun to look into ASP due to an assignments requirements
(I usually code in PHP), one feature in PHP is to be able to do an
if...else statement, where if a certain statement is true then a chunk
of HTML can be outputted...

Basically I want to be able to do this in ASP to use with a simple
authentication system which I will construct.

I have just got a fat book on ASP, and am beginning to read through it
etc

Regards

Lawrence
Which language are you using in the ASP page?

vbscript:-

<%
If BooleanExpression Then
%>
<!-- HTML Content here -->
<%
Else
%>
<!-- Alternative HTML Content here -->
<%
End If
%>

JScript:-

<%
if (booleanExpression)
{
%>
<!-- HTML Content here -->
<%
}
else
{
%>
<!-- Alternative HTML Content here -->
<%
}
%>

Apr 26 '07 #2
On Apr 26, 12:46 pm, "Anthony Jones" <A...@yadayadayada.comwrote:
"Lawrence" <lawrence.h...@gmail.comwrote in message

news:11**********************@r30g2000prh.googlegr oups.com...
Hi
I have only begun to look into ASP due to an assignments requirements
(I usually code in PHP), one feature in PHP is to be able to do an
if...else statement, where if a certain statement is true then a chunk
of HTML can be outputted...
Basically I want to be able to do this in ASP to use with a simple
authentication system which I will construct.
I have just got a fat book on ASP, and am beginning to read through it
etc
Regards
Lawrence

Which language are you using in the ASP page?

vbscript:-

<%
If BooleanExpression Then
%>
<!-- HTML Content here -->
<%
Else
%>
<!-- Alternative HTML Content here -->
<%
End If
%>

JScript:-

<%
if (booleanExpression)
{
%>
<!-- HTML Content here -->
<%}

else
{
%>
<!-- Alternative HTML Content here -->
<%}

%>
Ok thanks, gonna use VBScript I think, looks quite similar to the way
I would do it in PHP which is reassuring and also stupid of me for not
trying it in the first place ^_^

Many thanks

Lawrence

Apr 26 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by r0adhog | last post: by
3 posts views Thread by trialanderror | last post: by
13 posts views Thread by LRW | last post: by
reply views Thread by 42 | last post: by
10 posts views Thread by serge calderara | last post: by
6 posts views Thread by alexrussell101 | last post: by
24 posts views Thread by firstcustomer | last post: by

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.