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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enabling links after login

Status
Not open for further replies.

chinedu

Technical User
Mar 7, 2002
241
US
Please tell me if this is possible.

I have a page laid out like this:

link1
lin2
link3
----------------------- <-- This is a horizontal line

Login info

Username:________________
password:________________

All of these are on the same page.

My question is, is it possible to disable the links before login.
Once the user logs in successfully, the links will become enabled or active so they can click on it?

Thanks in advance for this great forum with great talents.
 
Should be able to use an if/then statement.
Code:
if logged in then
 response.write "<a href='page1.asp'>Link1</a>"
else
 response.write "Link1"
end if

------------------------------------------------------------------------------------------------------------------------
If you don't have a sense of humor, you probably don't have any sense at all.
- Anonymous
 
Thanks for the response Chopstik; I know that is an option but I was hoping to not have to use this option.

I was hoping to have the links clearly inactive/displayed but disabled before log in, only to be active /disapled after a successful login.
 
I'm not sure I understand what you want to do here -
You want the links displayed but inactive if the user is not logged in, and you want the links active and displayed if they are logged in.
You can just modifiy the code ChopStick gave you a bit. Just change the font properties of the Link within the IF/Else statement.
 
Changing the font property doesn't make it inactive, neither does it disable it.

What matters is that a user can see the available links; they just can't click on any of the links to open it.

That is what they want.
It is almost like registering a product; you can see a "Next" button but it won't be activated until you enter a certain information on the screen.
 
Change the font property to gray it out (still visible) and remove the href. Done. Where is the complexity?
 
You are right, I am such a dumb brain.

Thank you a lot.
 
I would suggest a select case method over the if statement, much more efficient.

www.sitesd.com
ASP WEB DEVELOPMENT
 
Also maybe you could try this:
Code:
<%
Select Case LoginVariable 
Case True
%>
<!--#include file="logged_in_links.asp"-->
<%
Case Else
%>
<!--#include file="NOT_logged_in_links.asp"-->
<%
End Select
%>

www.sitesd.com
ASP WEB DEVELOPMENT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top