Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested If Statement - Session States

Status
Not open for further replies.

Sprowler

IS-IT--Management
Sep 30, 2002
102
0
0
GB
Hello,

I am having trouble with a nested if statement that i need to implement within a menu bar. The menu loads items from a databases dependent on whether or not a customer holds a contract for this specific product, if the customer holds the contract then the submenu item is displayed.

My problem is a certain product type needs to be split, although the contracts are of the same type. I would like to load up a further sub menu item if a customer has access to a different particular product.

My code for reading in the menu items is as follows:

for each objItem in session("services")
if objItem.Value = "yes" then
menuText = menuText & "<div class=""navSub""><a href=""show.aspx?show=1&id=" & objItem.Key & "&menu=1"" class=""sub"">" & session("AllServices").Item(objItem.Key) & "</a></div>"
end if

This code checks to see if a member has a contract to a specific product and if it does then it displays the particular submenu so the customer has access to it

I would like to display a further product if a customer has a contract for product 7. So, simplified if the customer has a contract for product 7, also display product 9 within the submenu so the customer may access it.

Would this nested if statement work????

for each objItem in session("services")
if objItem.Value = "yes" then
menuText = menuText & "<div class=""navSub""><a href=""show.aspx?show=1&id=" & objItem.Key & "&menu=1"" class=""sub"">" & session("AllServices").Item(objItem.Key) & "</a></div>"

if session("services").Item(objItem.Key) = "7" then
menuText & "<div class=""navSub""><a href=""show.aspx?show=1&id=9&menu1"" class=""sub"">" EWS "</a></div>"
end if
end if

My knowledge regarding session states is poor, and i would appreciate any help. thank you


 
Would this nested if statement work????
Won't it be easier if you try it and then post back if it doesn't?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Its going live to the web. Im not gonna know unless i try, but dont want try it in case its wrong and the menu goes wrong.
 
So use a development server/pc to test it before it goes live...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top