IF display not working

I am using classic ASP / javascript

I have the following lines:

<% if ((Permissions.SecBillingedit)== "True") { %>

VALUE
 
<% } // end Permissions.EOF && Permissions.BOF %>

It should display the value when 'secbillingedit' is equal to "True", but it doesnt. What is wrong ?

If I display the value of the field in on my screen  I get "True" ... so not sure what may be wrong.
LVL 1
AleksAsked:
Who is Participating?
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
just to confirm, the database field "SecBillingedit" IS of a boolean type?

are you referencing that field any where else on the page?
0
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
if the database field is a boolean type, you just want to do:

<% if ( Permissions.SecBillingedit ) { %>

your original code is comparing the field to a string value of "True", not a boolean value
0
 
Brian PringleSystems Analyst II, SCM, ERPCommented:
The <% and %> should be around the entire if statement, not each line.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
no, thats inccorect. The <% %> can (and should be) on each line, especially if the part where the OP has VALUE is straight up html
0
 
AleksAuthor Commented:
Did not work. Nothing is displayed. It shoud compare and make sure the boolean value is '1' .. in the database it shows '1', but when displayed on the ASP page it shows "True"
0
 
AleksAuthor Commented:
The logic is correct, the 'value' or code I want to display is still not being displayed.

This is the complete code :

<% if ((Permissions.SecBillingedit)== "1") { %>

                          <a href="BillingItemsEdit.asp?ItemId=<%=(BillingItems.Fields.Item("Id").Value)%>&caseid=<%=(Casesjoin.Fields.Item("Id").Value)%>"><img src="../../Images/iedit.gif" width="16" height="16" border="0"></a>
                           
<% } // end Permissions.EOF && Permissions.BOF %>

I have tried and doesnt work with:

<% if ((Permissions.SecBillingedit)== "1") { %>
<% if ((Permissions.SecBillingedit)== "True") { %>
<% if ((Permissions.SecBillingedit)== '1') { %>
<% if ((Permissions.SecBillingedit)== 'True') { %>
0
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
then try comparing it to 1 then:

if ((Permissions.SecBillingedit)== 1))
0
 
AleksAuthor Commented:
Tried that, no go. Nothing is displayed.
0
 
AleksAuthor Commented:
Close enough, this worked:

<% if (Permissions('SecBillingedit')== "1") { %>
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
excellent! glad you got it working :)
0
 
AleksAuthor Commented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.