If statement

Results 1 to 5 of 5

Thread: If statement

  1. #1
    Veronica Guest

    Default If statement

    I am writing some code in an include file which is this:<BR><BR>&#060;%Response.buffer = True%&#062;<BR>&#060;%<BR>&#039;The user will only be allowed to view data, no adding, deleting or updating.<BR><BR>Dim usrType<BR>Dim sAction<BR><BR>Function HasAdminRights(securitylevel, ActID)<BR>If securitylevel&#060;&#062;"1" Then<BR> If ActId = 1 Then<BR> sAction = "response.write readonly"<BR> else<BR> sAction ="response.write disabled"<BR> End if <BR> <BR> HasAdminRights = sAction<BR>End if<BR>End function<BR><BR>Problem is it will only work when I use the "&#060;&#062;" sign but will not work if I use the "=" sign. Please someone help me, what could be the problwm. I did add a "Response.Buffer at the top of the page but it will still not work.

  2. #2
    Join Date
    Dec 1969

    Default RE: If statement

    response.write securitylevel <BR>before the if statement to see what the value is also check that is a "1" not a 1 (i.e. a number).<BR><BR>Also:<BR> sAction = "response.write readonly" <BR>What are you planning to do with that?<BR><BR>

  3. #3
    Veronica Guest

    Default RE: If statement

    The sAction response.write readonly will only allow the user to read the data on the form and is unable to dele or change it.

  4. #4
    Veronica Guest

    Default Oli or anyone

    I tried the response.write securitylevel before if statement

  5. #5
    Eddie Campbell Guest

    Default RE: Oli or anyone

    Well, are you going to tell us what you got ?<BR><BR>As Oli said, are you sure that you are sending a string ("1") rather than a number (1)?<BR><BR>What happens if you reome the " marks like this ?<BR>If securitylevel = 1 Then <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts