Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

IF display not working

Posted on 2013-10-28
11
Medium Priority
?
257 Views
Last Modified: 2013-10-28
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.
0
Comment
Question by:Aleks
  • 5
  • 5
11 Comments
 
LVL 34

Assisted Solution

by:Big Monty
Big Monty earned 2000 total points
ID: 39605625
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
 
LVL 16

Expert Comment

by:Brian Pringle
ID: 39605630
The <% and %> should be around the entire if statement, not each line.
0
 
LVL 34

Assisted Solution

by:Big Monty
Big Monty earned 2000 total points
ID: 39605644
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Aleks
ID: 39605645
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
 

Author Comment

by:Aleks
ID: 39605648
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
 
LVL 34

Assisted Solution

by:Big Monty
Big Monty earned 2000 total points
ID: 39605653
then try comparing it to 1 then:

if ((Permissions.SecBillingedit)== 1))
0
 

Author Comment

by:Aleks
ID: 39605668
Tried that, no go. Nothing is displayed.
0
 

Author Comment

by:Aleks
ID: 39605680
Close enough, this worked:

<% if (Permissions('SecBillingedit')== "1") { %>
0
 
LVL 34

Accepted Solution

by:
Big Monty earned 2000 total points
ID: 39605681
just to confirm, the database field "SecBillingedit" IS of a boolean type?

are you referencing that field any where else on the page?
0
 
LVL 34

Expert Comment

by:Big Monty
ID: 39605684
excellent! glad you got it working :)
0
 

Author Closing Comment

by:Aleks
ID: 39605702
:)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question