473,224 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 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 8755

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: r0adhog | last post by:
I have a very simple form: <html> <head> </head> <body> <% function ValForm() if len(document.form.newapp.all("AccessCode").Value) = 4 then document.form.newapp.submit()
3
by: trialanderror | last post by:
Both of these apply to using IE 6.0 or Netscape 7.x: First question: I am trying to set up a simple horizontal menu as a red strip across the browser window. Here is the relevant part of the...
13
by: LRW | last post by:
Having a problem getting a onSubmit function to work, to where it popsup a confirmation depending on which radiobutton is selected. Here's what I have: function checkdel() { if...
17
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
10
by: serge calderara | last post by:
Dear all, I need to build a web application which will contains articles (long or short) I was wondering on what is the correct way to retrive those article on web page. In orther words, when...
6
by: alexrussell101 | last post by:
For anyone who can't be bothered to read my code and examples, scroll to the bottom, the question's there. Thanks. I'm using php and regular expressions to convert bbcode style things to html....
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
7
by: freddukes | last post by:
Okay... So this is my first project and I want to be able to make a tool tip appear with the basket contents whenever you hover over a link using the onmousehover='javascriptFunction()'. I have...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.