Simple if...else asp/html question

Discussion in 'ASP General' started by Lawrence, Apr 26, 2007.

  1. Lawrence

    Lawrence Guest

    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
    Lawrence, Apr 26, 2007
    #1
    1. Advertising

  2. "Lawrence" <> wrote in message
    news:...
    > 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 -->
    <%
    }
    %>
    Anthony Jones, Apr 26, 2007
    #2
    1. Advertising

  3. Lawrence

    Lawrence Guest

    On Apr 26, 12:46 pm, "Anthony Jones" <> wrote:
    > "Lawrence" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > 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
    Lawrence, Apr 26, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    25
    Views:
    646
    MonkeeSage
    Oct 1, 2006
  2. kj
    Replies:
    15
    Views:
    535
    Lawrence D'Oliveiro
    May 23, 2009
  3. Sandy

    Simple if-else question

    Sandy, Sep 29, 2009, in forum: Python
    Replies:
    16
    Views:
    553
    Olof Bjarnason
    Oct 1, 2009
  4. A
    Replies:
    8
    Views:
    779
    James Kanze
    Aug 28, 2010
  5. Gergely Kontra
    Replies:
    16
    Views:
    217
    Devin Mullins
    Sep 20, 2005
Loading...

Share This Page