468,532 Members | 1,703 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,532 developers. It's quick & easy.

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 8276

"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
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.