Dreamweaver Conditional Statement Code

I'm just trying to figure out what the colon : does in this code:

<%If (Not isNull(COLOR)) Then If (COLOR = "Blue") Then Response.Write("SELECTED") : Response.Write("")

I thought it may be the ASP version of the Ternary operator, but it doesn't have the same effect. Is it just another way to concatenate? or a reverse concatenate?
or maybe a addition of an empty string to make sure that the output from the response.write statement is a string and not a number?

If the second response statement has a value then it prints it e.g. Code:

View Replies


ADVERTISEMENT

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

View Replies View Related

Conditional Statement

I have a code for executing a stored procedure and returning a recordset wrapped in an IF statement. If the statement is true the code executes. If the statement is false the code is skipped.

On the page, I want to display a message if the Recordset returned from the stored procedure is empty.

<% If rs.BOF or rs.EOF Then %>

Message

<% End If %>

Running the above code will return an error message if the recordset object doesn't exist...i.e. if the stored procedure hasn't executed and returned the recordset object.

How can I write the code to include that condition?

View Replies View Related

Advanced Conditional Statement

URLURLI need help writiing an advanced conditional statement.I want to display an image if two recordset values = 1 or other various number combinations.

This statement works with one, how could I edit this statement to include two recordsets values? Say I want to add another feild say "recent" to this statement and it has a value of 2

Code:

<% if Recordset1.Fields.Item("progress").Value = 1 then ' Adv Conditional Region %>
<% end if ' Recordset1.Fields.Item("progress").Value = 1 %>

View Replies View Related

Conditional Statement On DB Currency Field

Given a value in a database (Access) of type Currency how do I write a conditional statement such as the following:

if rs("price") > "$1,000,000" Then
Response.Write " Luxury Home"
End If

When I try this it writes out Luxury Home for every record, regardless of the value in Price.

View Replies View Related

Conditional Statement If SFileName <> "" THEN

know what an if statement is, and dont' find that challenging. However what the heck does this mean in ASP? Code:

if sFileName <> "" THEN

Does it mean if sFileName is not empty then do the following?

View Replies View Related

"less Than" Conditional Statement

I am trying to do a simple "less than" conditional statement, and hitting a brick wall if I use a database element with it.

This DOES work:
<%
if Request.QueryString("PC") < 10 then Response.Write("less than ten") else
Response.Write("more than or equal to ten") End if
%>


This DOES NOT work:
<%
if Request.QueryString("PC") < Record.Fields.Item("count(*)").Value then
Response.Write("less than COUNT") else Response.Write("less than or equal to
count") End if
%

View Replies View Related

Replacing "For Each" Statement In Mail Sending Code

The following script sends form results in an html email. It causes each form field result to have exactly the same html. I need it to have unique html for each form field result. Can you help???? I tried changing the for each statement to a for statement but couldn't figure it out.

The original code is : (from Brainjar.com - I emailed them but they did not respond)

body = "<table border=""0"" cellpadding=""2"" cellspacing=""0"">" & vbCrLf
for each name in fieldOrder
body = body _
& "<tr valign=""top"">" _
& "<td><b>" & name & ":</b></td>" _
& "<td>" & Request.Form(name) & "</td>" _
& "</tr>" & vbCrLf
next
body = body & "</table>" & vbCrLf

View Replies View Related

Conditional IF

I have a form with a list/menu where you select the year you were born. Now, when I submit this form, it creates a new register in my database etc.

How can I use a conditional to redirect a person that for example was born in 1987 or less?

if request.form("year")="1987" then%> is this the correct way to start?

View Replies View Related

URL Conditional

I have a ton of dynamic pages that I need an asp conditional to run on.I know the urls of all the pages and I want to know if there is an easy way to write a conditional statement that if they are on a specific page that it outputs something depending on the url they are on. Is there an easy way to do this?

View Replies View Related

Conditional

I have the following simple conditional on my page,

If EmpIDError <> 1 Then
'Show Input items
End If

Now I need to add another conditional to this,

If PosIDError <> 1 Then
'Show input items
End If

So I made it like this,

If EmpIDError <> 1 OR PosIDError <> 1 Then

But the problem is that if PosIDError = 1, then it still shows the input
items. But if I take the EmpIDError <> 1 out then it works with no
problems. Why would this be like this?

View Replies View Related

Conditional Inculde

I have written a small library for ASP, and I tried to keep it in a modular fashion, splitting my library in some files.

Then I have a file named "framework.asp" that include all the other files.

The problem is that I can't reuse code internally to my library because if for example:

framwork.asp include:
- utils.asp
-html.asp

Then html.asp include:
-utils.asp

If the programmer include framework.asp would have 2 times the same file utils.asp in his ASP page! Code:

View Replies View Related

Conditional Includes

Will this work in asp 3.0:

If True Then
<!-- #include file="test1.asp" -->
Else
<!-- #include file="test2.asp" -->
End If

View Replies View Related

Conditional Formatting

i have an simple invoice sheet and in "total" coloumn i need to put a formula like IF < 8.50 THEN VALUE =8.50.it is something like we dont do delivery less then 8.50 so if the TOTAL is less than 8.50 then it should turn in to 8.50 automatically.

View Replies View Related

Conditional Compilation

One of my asp pages can be loaded in two ways - it may be submitted to itself (and therefore contains user data) or it can be loaded by clicking on a link on my menu, and consequently all fields are empty.

If the fields contain values (ie. the submit button was pressed), i want to load data from my database into an array, but if it is accessed via a link, i don't want this data to be loaded. So essentially, i want to know if there is some form of conditional compilation or something in asp (i know it technically shouldn't be called that, but i'm coming from a c++ background, so...) similar to the #if and #elif type directives in C

I can't place the code in a subprogram and selectively call it, because I want the arrays to be global so all my client-side scripts can access the data I'm using VBScript for the asp scripting.

View Replies View Related

Conditional Sql Statements

I have a shopping cart that I want to load items in that come from a huge scrolling form. In other words, when someone clicks on a category in our site, it scrolls out all the items in that category, maybe 30 or more. I have text boxes next to each item so somone can enter a number, then press submit form button at the bottom of the form, and
send those slections to the shopping cart.

The problem is, many of the text boxes are empty, yet they are still being sent to the shopping cart as a quatity of 0. Is there a way for sql to ignore a value if the variable is zero, or only get the sql statement to run if a variable is > 0?

View Replies View Related

Nested If Else Conditional Statament

I am not too sure wats wrong w the if-else statement below!

<%if(grp==grp2)%>
{
<%if (start==req || end==req)%>
{
<%=grp%>
<%=start%>
<%=end%>
}
<%else%>
{
<%="There is no such record found"%>
}
}
<%else%>
{
<%="There is no such record found!"%>
}
<%endif%>

Error: 'else' without 'if'.
else
^

View Replies View Related

Conditional Display Of Data From DB

displays content IF several conditions exist or display's nothing if it doesn't?

Basically, in english this is what I'm trying to do:

IF a record exists

WHERE session(userID) = idByUserID in 'notes'
AND
WHERE userID = idAboutUserID in 'notes'

THEN

display from the record fieldnames 'LastUpdate' and 'note'

ELSE
don't display anything

View Replies View Related

Conditional Page Re-direct

I have a 'primary' intranet website and a 'secondary' backup of this site as
well. I would like to programmatically have the effect that if the
primary site is (page not found 404) not available, for it to access the
secondary site or at least be able to add a message with (or instead of) the
404 error dialog that the primary site is down and give the user a link to
the alternative (secondary) site.

View Replies View Related

Evaluating A QueryString In A Conditional

Ok I know this is simple but I cannot get it to work.
on the URL I have:

.../default.asp?strCode=xxx

I then have:

If Request.QueryString("strCode") = "xxx" Then
Response.Write "code is XXX"
End If

So for some reason it is not evaluating the queryString and does not enter into the conditional. Why?

View Replies View Related

Conditional Routine And Date

I'm trying to not show some data dependant on date but it never works right.

<% If Request.QueryString("EventDate") > DateAdd("d",6,Date()) Then %>

I have used similar routines before and it worked fine but this time i'm using a QueryString instead of a database field.

View Replies View Related

Conditional Color Formatting Of Field In A Table

This is probably a simple question, but how does one format a table such that if a field is a certain value, then it will have a specific color.

For example, in the code below, if the specific field named "Year" is '2004' then I want it to appear in red, otherwise it should appear in black. Code:

View Replies View Related

Dreamweaver Mx

using dreamweaver mx,i created a 'jump menu' trying to do this below:

Code:
<option value="Settings/CT2004S1/setCT2004S1.asp?paper=Common Test 2004 Semester 1" selected>Common

but seem not possible..
<%response.write Request.QueryString("Paper")%>

View Replies View Related

Dreamweaver MX


Dreamweaver MX has a behavior called Restrict Access To Page. It is not working for me. I have Access 2000 db set up and working. The registration and login pages work based on the database info. It is only this behavior I can not get to work. My db has a field AccessLevel. There I made sure I had admin entered to match to the Behavior condition. I still do not get access to the page even though the admin is the AccessLevel condition.

Here is the code.....

View Replies View Related

ASP - Dreamweaver

I keep my church's website updated. Recently they got someone to do a new design. This guy used asp for all the pages and I know nothing about it. When I try to make updates I try to view the page with DreamweaverMX 2004, but it all comes out funky looking.

The footer is at the top of the page, the text is all on one side. Graphics are just wherever. Believe it or not I can update this, but I frequently have to do pages from scratch and I would like to know what it will look like before I download to the server. Is there some setting I can change on Dreamweaver to make things look right.

Our designer doesn't have a clue. He just says to learn to write code. I can learn the code if I have to but we have other volunteers who aren't as computer savvy.

View Replies View Related

Dreamweaver MX Extensions CMS?

I'm just about to embark on building a custom cms with Dreamweaver MX with ASP. I've done something on a very mico level, but i'm gonna go bigger this time.

Something along the lines of Interactive Tools Page Publisher.

Can someone recomend some invaluable (and free) Dreaweaver extensions that can help in this process. Also, if there are any good DWMX tutorials and open source stuff that can help in this process.

View Replies View Related

Dreamweaver Login And MD5

I'm using the out of the box Dreamweaver login script (I'm a super noob developer) and I'm interfacing with a database that uses MD5 to protect passwords. I need help modifying the DW code to work with this. Code:

View Replies View Related

Dreamweaver Or Studio?

I've tried (during a trial period) Dreamweaver quite extensively for HTML coding. I thought it did a good job of that. I'm just dipping my toes into ASP, and I was wondering if people found it as good for ASP programming as they did for HTML.

I'm seriously thinking about purchasing either Dreamweaver or, may be Studio.

View Replies View Related

Dreamweaver Security

I see that Dreamweaver MX has a pre-written ASP login script that you can just drop in, as well as a drop-in for every page to ensure users are logged in before they can view the page.

Can any security-types out there tell me if this is any good? We're setting up one site where the database is above root level, so I'm hoping that the DW system will provide adequate security (since its SOOO easy to use). Will it?

View Replies View Related

Connecting With Dreamweaver

Im using dream weaver to connect to my database. I hav e made my connection successfully,
added my recordset succesfully....however when i insert my dynamic text.....

I get this: Code:

View Replies View Related

Jscript Dreamweaver

Can someone tell me , how to apply jscript in dreamweaver, as well as the example, because I am trying to run jscript script with an include file ....

View Replies View Related

Is Dreamweaver Good?

I've been doing ASP by hand-coding in either Homesite or Interdev for years. I have been using Dreamwever for static sites that I make on the side. I recently was asked to make a form which will store info in an Access database, and thought it would be a good chance to learn how to use Dreamweaver MX's ASP capabilities.

Haven't tried it yet, but reading up on it, it seems that it forces you to use Session variables. I'm not a big fan of session variables, and want to avoid them. Anyone here use DW MX for ASP?

View Replies View Related

Frontpage / Dreamweaver FTP

I know that this is not the most appropriate forum for this question, but after the excellent advice i have recieved from some members about various things I figured I would wrack your brains. The situation is this: The webserver in question is settled behind a firewall, and you can only get ftp access if your ip address is on a trusted list. A colleague of mine wants to access it from home but due to the fact that he has a dynamic ip address he is unable to be added to the trusted list.

I assumed that his access would be denied, and sure enough when i configured dreamweaver for the site it did indeed fail to connect. So far this makes sense, but then I discovered that if, when on the website in IE, if he clicks the edit with frontpage button frontpage will open and give him access to the site once he has logged in with the correct username/pass. He really needs to be able to access the site via dreamweaver so im wondering if anyone can explain how FrontPage is able to get access and if this information can be used to get dreamweaver connecting.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved