Aleks
asked on
ASP/javascript in ASP/VBscript
I have this code which works for ASP/Javascript pages
<% if (Qnrview.Fields.Item("Para mValue").V alue == (1)) { // script %>
HELLO
<% } // if (Qnrview.Fields.Item("Para mValue").V alue == (1)) script %>
I need to aquivalent for ASP/VB Script
<% if (Qnrview.Fields.Item("Para
HELLO
<% } // if (Qnrview.Fields.Item("Para
I need to aquivalent for ASP/VB Script
Also.
Since you are just getting into ASP Classic VB
May I suggest the following Video Lesson's
http://www.youtube.com/playlist?list=PL00AD0C15B4892027
Good Luck
Carrzkiss
Since you are just getting into ASP Classic VB
May I suggest the following Video Lesson's
http://www.youtube.com/playlist?list=PL00AD0C15B4892027
Good Luck
Carrzkiss
if you have other values for ParamValue, I would use a select statement:
<%
dim param: param = Qnrview("ParamValue")
if param = "" or not isNumeric( param ) then
param = -1
else
param = CInt( param )
end if
if param > -1 then
select case param
case 1: Response.Write "Hello 1"
case 2: Response.Write "Hello 2"
default: "Default message if param doesn't equal the other values"
end select
end if
<%
dim param: param = Qnrview("ParamValue")
if param = "" or not isNumeric( param ) then
param = -1
else
param = CInt( param )
end if
if param > -1 then
select case param
case 1: Response.Write "Hello 1"
case 2: Response.Write "Hello 2"
default: "Default message if param doesn't equal the other values"
end select
end if
' trim takes out any space " 1 " becomes "1".
' Cstr converts numeric to a string. This way you account for blanks.
if Cstr(trim(Qnrview.Fields.Item("ParamValue").Value))="1" then
response.write "hello, I am 1"
else
response.write "sorry, I am not 1"
end if
' if you want to account for the null values
if not isnull(Qnrview.Fields.Item("ParamValue").Value) then
if Cstr(trim(Qnrview.Fields.Item("ParamValue").Value))="1" then
response.write "hello, I am 1"
else
response.write "sorry, I am not 1"
end if
end if
ASKER
Lets try once more. I have this code in Classic ASP/Javascript and need two lines in ASP/VBScript to replace this code:
<% if (Qnrview.Fields.Item("Para mValue").V alue == (1)) { // script %>
HELLO
<% } // if (Qnrview.Fields.Item("Para mValue").V alue == (0)) script %>
HELLO1
<% if (Qnrview.Fields.Item("Para
HELLO
<% } // if (Qnrview.Fields.Item("Para
HELLO1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
just curious, did none of the solutions already posted meet your needs?
The code that I posted above
http:#a39830330
Will do what you want, in VB, just as your code did in JS.
With the least amount of code lines.
http:#a39830330
Will do what you want, in VB, just as your code did in JS.
With the least amount of code lines.
ASKER
Sorry .. I have been out all day. I will test this tomorrow morning
ASKER
Perfect, thanks !
Open in new window
Carrzkiss