Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IF display not working

Posted on 2013-10-28
11
Medium Priority
?
255 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:amucinobluedot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 33

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 33

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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 

Author Comment

by:amucinobluedot
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:amucinobluedot
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 33

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:amucinobluedot
ID: 39605668
Tried that, no go. Nothing is displayed.
0
 

Author Comment

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

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

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 33

Expert Comment

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

Author Closing Comment

by:amucinobluedot
ID: 39605702
:)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video teaches users how to migrate an existing Wordpress website to a new domain.

718 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