a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Access Level Navigation - turn off links?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Access Level Navigation - turn off links?
Page: [1]
 
rubyaim

 

Posts: 757
Joined: 6/22/2005
Status: offline

 
Access Level Navigation - turn off links? - 11/9/2006 21:15:43   
Hi, I am redoing the navigation on an application and am using Access Levels (Spooky) to show links available to the different levels.

I'd like to show all links but have them greyed out (not clickable) if a user does not have the appropriate Access Level - I don't mind them seeing all areas available. Any ideas on how to do this dynamically?

This is what I have so far, the navigation is in an include file.

<% ON ERROR RESUME NEXT
If Session("UserName")&"" = "" Then
Response.redirect "/login.asp?Redirect=" &Request.Servervariables("URL")
End if
If cint(Session("AccessLevel")) > 4 Then
Response.redirect "/login.asp?Redirect=" &Request.Servervariables("URL")
End if
%>


<body>
<ul id="topmenu">
<% If Session("Accesslevel") <= "2" then %>
<li class="main" style="border-left-width: 1px">
<div class="headers">
<div class="exp"><a href="data-entry.asp">Data Entry</a> </div>
</div>
<ul class="subs" style="width: 16em">
<li>
<a href="test1.asp">Data Entry 1</a></li>
<li>
<a href="test2.asp">
Data Entry 2</a></li>
</ul>
</li>

<% else %>
<li class="main" style="border-left-width: 1px">
<div class="headers">
<span class="gry">Data Entry</span>
</div>
<% end if %>

and so on.

There are around 50 pages to call into the navigation so I was wondering if there was a way of just turning the links on or off depending on the Access Level?



_____________________________

Sally
Spooky

 

Posts: 26617
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Access Level Navigation - turn off links? - 11/10/2006 13:48:51   
Not really - what you have there is pretty much the way Id do it. As long as its an include, it'll make it easier to change for all pages.

This one here :
<% If Session("Accesslevel") <= "2" then %>

Should be :
<% If cInt(Session("Accesslevel")) <= 2 then %>

When using "2" its performing a textual comparison so it wont understand <=
However, youll need to ensure that the session is numeric for all users else it may error

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to rubyaim)
rubyaim

 

Posts: 757
Joined: 6/22/2005
Status: offline

 
RE: Access Level Navigation - turn off links? - 11/10/2006 16:51:15   
Hi Spooky, many thanks, I'll keep working on the include as is.

quote:

Should be :
<% If cInt(Session("Accesslevel")) <= 2 then %>

I'm so pleased you pointed that out - it would have driven me crazy when testing!

Thanks again :)

_____________________________

Sally

(in reply to Spooky)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> Access Level Navigation - turn off links?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts