473,396 Members | 1,914 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,396 software developers and data experts.

Conditional Statement

I've got the following VB in an ASP page and can't see why it won't work

<% if Request.QueryString(Failed=="N")%> The Failed variable is N <% else
%>The failed variable is not N<% end if %>

I'm calling the page as thepage.asp?Failed=N

Any one?
Jul 19 '05 #1
4 2055
Try

<% if Request.QueryString("Failed")="N" then %>

your HTML Code

<% end if %>

Rafael

"Andrew Banks" <ba****@nojunkblueyonder.co.uk> wrote in message
news:XM*********************@news-text.cableinet.net...
I've got the following VB in an ASP page and can't see why it won't work

<% if Request.QueryString(Failed=="N")%> The Failed variable is N <% else
%>The failed variable is not N<% end if %>

I'm calling the page as thepage.asp?Failed=N

Any one?

Jul 19 '05 #2
"Andrew Banks" <ba****@nojunkblueyonder.co.uk> wrote in message
news:XM*********************@news-text.cableinet.net...
I've got the following VB in an ASP page and can't see why it won't work
<% if Request.QueryString(Failed=="N")%> The Failed variable is N <% else %>The failed variable is not N<% end if %>

I'm calling the page as thepage.asp?Failed=N

Any one?


<% If Request.QueryString("Failed") = "N" Then %>
The Failed variable is N
<% Else %>
The Failed variable is not N
<% End If %>
Jul 19 '05 #3
"Andrew Banks" <ba****@nojunkblueyonder.co.uk> wrote in message
news:XM*********************@news-text.cableinet.net...
Andrew,

<% if Request.QueryString(Failed=="N")%>

Three things wrong here.
1. VB requires the Then keyword at the end of the condition,
2. Request.QueryString is a Collection, so you need to extract the
item you want either by index (number) or name, and
3. VB doesn't use "==" for its equality test [yet].

<%
If Request.QueryString( "Failed" ) = "N" Then
Response.Write "The Failed variable is N"
Else
Response.Write "The failed variable is not N"
End If
%>

HTH,
Phill W.
Jul 19 '05 #4
Thanks all, much apreciated

I'm usually a PHP guy and dabble with a bit of C#.NET - I just have to
complete this one task in ASP VB
"Andrew Banks" <ba****@nojunkblueyonder.co.uk> wrote in message
news:XM*********************@news-text.cableinet.net...
I've got the following VB in an ASP page and can't see why it won't work

<% if Request.QueryString(Failed=="N")%> The Failed variable is N <% else
%>The failed variable is not N<% end if %>

I'm calling the page as thepage.asp?Failed=N

Any one?

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: neblackcat | last post by:
Would anyone like to comment on the following idea? I was just going to offer it as a new PEP until it was suggested that I post it here for comment & consideration against PEP 308. I'm far...
7
by: Guy Hocking | last post by:
Hi there, I have a problem in my ASP/SQL Server application i am developing, i hope you guys can help. I have a ASP form with list boxes populated by SQL tables. When a user selects a value...
2
by: in | last post by:
In Visual Studio, is there a way of marking a statement as a "conditional run". Sort of like a breakpoint, but there, in the debugger, the statement will not execute. I'm thinking of code...
7
by: Shaldaman | last post by:
I have an Access form called "Login". "Command10" is a button on the form and "Text5" is a text field on it. When a user enters a value in the Text5 text field and clicks the button Command10, I...
4
by: mux | last post by:
Hi I found out that the following piece of code throws an error. 1 #include "stdio.h" 2 3 int main() 4 { 5 int a,b; 6 a= 10;
9
by: Marty | last post by:
Hi, Does using the the conditional operator (?:) instead of the common "if" statement will give a performance gain in a C# .NET 2003 application (even in C# .NET 2005?). What is the advantage...
5
by: paulo | last post by:
Can anyone please tell me how the C language interprets the following code: #include <stdio.h> int main(void) { int a = 1; int b = 10; int x = 3;
43
by: dev_cool | last post by:
Hello friends, I'm a beginner in C programming. One of my friends asked me to write a program in C.The purpose of the program is print 1 to n without any conditional statement, loop or jump. ...
13
by: Neal Becker | last post by:
In hindsight, I am disappointed with the choice of conditional syntax. I know it's too late to change. The problem is y = some thing or other if x else something_else When scanning this my...
7
by: tiptap | last post by:
Hey Guys, I have a huge statement loads of if statements in... and its getting bigger. On closer inspection there is only 3 difference in the select statement. so I thought I could cut the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.