Setting ASP Sessions

garethtnash
garethtnash used Ask the Experts™
on
Is this the best way to set the sessions detailed below -

<% IF UserAccess.Fields.Item("VAT-Liable") = "N" AND UserAccess.Fields.Item("Eire-Member") = "Y" Then
Session("MemberVatCharge")="N"
ElseIF UserAccess.Fields.Item("VAT-Liable") = "N" AND UserAccess.Fields.Item("EU-Member") = "Y" Then
Session("MemberVatCharge")="N"
Elseif UserAccess.Fields.Item("UK-Member") = "Y" Then
Session("MemberVatCharge")="Y"
End if %>
<%
 Session("USERNAME")=(UserAccess.Fields.Item("Username").Value)
 Session("USERID")=(UserAccess.Fields.Item("ID").Value)
 Session("Name")=(UserAccess.Fields.Item("Name)
 %>

Open in new window


Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007
Commented:
Slightly refactored:
''
<%
IF UserAccess.Fields.Item("VAT-Liable") = "N" Then
    If UserAccess.Fields.Item("Eire-Member") = "Y" Or UserAccess.Fields.Item("EU-Member") = "Y" Then
        Session("MemberVatCharge")="N"
    End If
Elseif UserAccess.Fields.Item("UK-Member") = "Y" Then
    Session("MemberVatCharge")="Y"
End If

Session("USERNAME") = (UserAccess.Fields.Item("Username").Value)
Session("USERID") = (UserAccess.Fields.Item("ID").Value)
Session("Name") = (UserAccess.Fields.Item("Name)
 %>
''

Open in new window

Author

Commented:
Thank you
Top Expert 2007

Commented:
No worries - glad to help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial