• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 478
  • Last Modified:

ASP Javascript "IF" Syntax

This should be a simple one.

I am trying to add an IF statement using ASP/Javascript

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

MY CODE

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

Where permissions is the recordset and SecBillingedit is the field value
0
Aleks
Asked:
Aleks
1 Solution
 
GaryCommented:
ASP and JavaScript are separate entities - they cannot talk to each other per se.
ASP is executed on the server, sends the HTML the browser and that is that - ASP is finished with it
Js is used in the browser.
0
 
AleksAuthor Commented:
Ok .. ASP .. whats the correct syntax for the above ?
0
 
GaryCommented:
I don't know because I have no idea what you are trying to do
Are you trying to add a js function into the page if the condition is true?
Is this classic ASP or .net?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Robert SchuttSoftware EngineerCommented:
Seems like you need server-side "JScript" which is similar to Javascript and needs parentheses around the entire if expression:
<% if ((Permissions.SecBillingedit)== "True") { %>

Open in new window

0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
You don't hear much about jscript.  Serverside javascript is starting to come in vogue. Too bad this was never developed more. But it does run slower compared to serverside vbscript for similar functions.  If you can do a function client side, it will run significantly faster.
0
 
AleksAuthor Commented:
Thats ok, in the future will be turned to ASP/VBscript.
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.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now