CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Hide before/after login links

Print topic Send  topic

Author Message
Bubba

Posts: 33
Posted: 02/08/2004, 2:45 PM

I realise this is probably simple, but EVERYTHING based on similar questions/answers in forum archive I have tried have failed.

I have a login and logout link(s) in my header.

I want to hide the logout link when a user is not logged in, and show logout / hide login when they are logged in. I am using CCS 2.2.2.40, ASP, with Win2k

After 50 attempts, this was my last one:

Dim Connection1
Dim HideLinks

Set Connection1 = New clsDBConnection1
Connection1.Open
HideLinks = CCDLookUp("Name","UserCode","User_ID="&CCGetUserID(), Connection1)
If HideLinks = "" Then
Logout.Visable = False
Else
Logout.Visable = True
Connection1.Close
Set Connection1 = Nothing
End if

Absolutely no joy - I get "property not available" for Logout.Visable = False

I then get "Connection1 not a variable"

Would really appreciate any help on this

Thanks in advance


View profile  Send private message
peterr


Posts: 5971
Posted: 02/08/2004, 3:17 PM

Let's start with fixing the spelling error. Please change "Visable" to "Visible" and see what happens.
Please make sure that you change this everywhere in your code - I see it in 3 places.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Bubba

Posts: 33
Posted: 02/08/2004, 5:25 PM

Thx Peter,

As silly as I feel for those typos - they were not in my code (only in my hasty re-type here).

I have since tried a new more simple approach with mixed results:

Function Header_BeforeShow() 'Header_BeforeShow @1-864E5C27

'Custom Code @12-73254650
' -------------------------
If Session("UserID")= "" Then
Header.Logout.Visible = False
Else
Header.Logout.Visible = True
End if
' -------------------------
'End Custom Code

End Function 'Close Header_BeforeShow @1-54C34B28

What happens here is when I am not logged in - the Logout (label) still appears on the header page, but holding my mouse over the link shows the link (URL) has disappeared (in the browser status bar).
ie: http://localhost/myproject/

When I log in the Logout label is still visible, but the URL is back !???
ie: http://localhost/myproject/index.asp?Logout=True

btw, my Logout link is a Form Link - does this make a difference?

dazed and confused...
View profile  Send private message
peterr


Posts: 5971
Posted: 02/08/2004, 5:46 PM

If "Logout" is a Link and a part of it disappears then it's possible that everything probably works as it should. You may only need to right-click on your Link, select "Edit Link ..." option, then set the "Extended HTML" option.

If "Logout" is a Label (or you want to make it a Label) then you shouldn't need to make it Visible or not, just specify:
If Session("UserID")<> "" Then Header.Logout.Value = "http://www.something..."

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Bubba

Posts: 33
Posted: 02/08/2004, 6:38 PM

Quote peterr:
You may only need to right-click on your Link, select "Edit Link ..." option, then set the "Extended HTML" option.

Whooo hooooo!! Thanks so much Peter - that did the trick! Mind you, checking the "Extended HTML" box is not something I would have thought/guessed to do - so gr8 job - thx mate ;-)
View profile  Send private message
Andrew Asher
Posted: 02/21/2004, 1:04 PM

This is a multi-part message in MIME format.

------=_NextPart_000_000A_01C3F92B.509BBEC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Bubba,
I have had a similar problem with a Hello "loginname" message in the =
header - it says Please log in when not logged in and uses a "hello =
Login Name" when they are logged in.

I'm not sure if it was the right approach but I had to put a DB =
connection ( I actually use a form with a hidden field in it that has =
real data in it) in to the main page ie; the default.asp page (and all =
others that didnt have any forms on them) - every time I tried to just =
have the connection in the header page it just wouldnt work and I =
received the kind of errors you are getting here. It works fine of =
course if the page had a form with a DB connection in it.

So my code is this - I have a Label in the header page called "Welcome" =
and This code placed as a "Before Show" custom code

header.Welcome.Value =3D "Welcome, please login to use the service"
If Session ("UserID") >=3D1 then header.Welcome.Value =3D "Hi " & =
(CCDLookUp("user_first_name", "all_user", "user_ID=3D" & =
CCGetUserID(),DBConnection1))& ", welcome to the service"


DB=3D "Connection1"
User Table =3D "all_user"
Users name =3D "user_first_name"
User ID =3D "User_ID"

Good luck=20
Andrew





"Bubba" <Bubba@forum.codecharge> wrote in message =
news:64026bbfd4f19d@news.codecharge.com...
> I realise this is probably simple, but EVERYTHING based on similar =
questions/answers in forum archive I have tried have failed.
>=20
> I have a login and logout link(s) in my header.
>=20
> I want to hide the logout link when a user is not logged in, and show =
logout / hide login when they are logged in. I am using CCS 2.2.2.40, =
ASP, with Win2k
>=20
> After 50 attempts, this was my last one:
>=20
> Dim Connection1
> Dim HideLinks =20
>=20
> Set Connection1 =3D New clsDBConnection1
> Connection1.Open
> HideLinks =3D =
CCDLookUp("Name","UserCode","User_ID=3D"&CCGetUserID(), Connection1)
> If HideLinks =3D "" Then
> Logout.Visable =3D False
> Else
> Logout.Visable =3D True
> Connection1.Close
> Set Connection1 =3D Nothing
> End if
>=20
> Absolutely no joy - I get "property not available" for Logout.Visable =
=3D False
>=20
> I then get "Connection1 not a variable"
>=20
> Would really appreciate any help on this
>=20
> Thanks in advance
>=20
>=20
>=20
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
------=_NextPart_000_000A_01C3F92B.509BBEC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Bubba,<BR>I have had a similar problem =
with a Hello=20
"loginname" message in the header - it says Please log in when not =
logged in and=20
uses a "hello Login Name" when they are logged in.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm not sure if it was the right =
approach but=20
<STRONG><EM>I had to put a DB connection ( I actually use a form with a =
hidden=20
field in it that has real data in it) in to the main page</EM></STRONG> =
ie; the=20
default.asp page (and all others that didnt have any forms on them) - =
every time=20
I tried to just have the connection in the header page it just wouldnt =
work and=20
I received the kind of errors you are getting here.  It works fine =
of=20
course if the page had a form with a DB connection in it.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><FONT face=3DArial>So my code is this - I have a =
Label in the=20
header page called "Welcome" and This code placed as a "Before Show" =
custom=20
code<BR><BR></FONT><FONT face=3DArial color=3D#800000 =
size=3D3>header.Welcome.Value =3D=20
"Welcome, please login to use the service"<BR>If Session ("UserID") =
>=3D1 then=20
header.Welcome.Value =3D "Hi " & (CCDLookUp("user_first_name", =
"all_user",=20
"user_ID=3D" & CCGetUserID(),DBConnection1))& ", welcome to the=20
service"</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>DB=3D "Connection1"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>User Table =3D "all_user"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Users name =3D =
"user_first_name"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>User ID =3D "User_ID"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Good luck <BR>Andrew</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial><BR><BR><FONT =
size=3D2></FONT></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>"Bubba" <</FONT><A=20
href=3D"mailto:Bubba@forum.codecharge"><FONT face=3DArial=20
size=3D2>Bubba@forum.codecharge</FONT></A><FONT face=3DArial =
size=3D2>> wrote in=20
message </FONT><A href=3D"news:64026bbfd4f19d@news.codecharge.com"><FONT =

face=3DArial =
size=3D2>news:64026bbfd4f19d@news.codecharge.com</FONT></A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> I =
realise this is=20
probably simple, but EVERYTHING based on similar questions/answers in =
forum=20
archive I have tried have failed.<BR>> <BR>> I have a login and =
logout=20
link(s) in my header.<BR>> <BR>> I want to hide the logout link =
when a=20
user is not logged in, and show logout / hide login when they are logged =

in.  I am using CCS 2.2.2.40, ASP, with Win2k<BR>> <BR>> =
After 50=20
attempts, this was my last one:<BR>> <BR>> Dim Connection1<BR>> =
Dim=20
HideLinks  <BR>> <BR>>    Set Connection1 =3D New=20
clsDBConnection1<BR>>     Connection1.Open<BR>>=20
   HideLinks =3D=20
CCDLookUp("Name","UserCode","User_ID=3D"&CCGetUserID(), =
Connection1)<BR>>=20
If HideLinks =3D "" Then<BR>> Logout.Visable =3D False<BR>> =
Else<BR>>=20
Logout.Visable =3D True<BR>>      =
Connection1.Close<BR>>=20
    Set Connection1 =3D Nothing<BR>> End if<BR>> =
<BR>>=20
Absolutely no joy - I get "property not available" for Logout.Visable =
=3D=20
False<BR>> <BR>> I then get "Connection1 not a variable"<BR>> =
<BR>>=20
Would really appreciate any help on this<BR>> <BR>> Thanks in=20
advance<BR>> <BR>> <BR>> <BR>>=20
---------------------------------------<BR>> Sent from YesSoftware=20
forum<BR>> </FONT><A href=3D"http://forums.codecharge.com/"><FONT =
face=3DArial=20
size=3D2>http://forums.codecharge.com/</FONT></A><BR><FONT face=3DArial =
size=3D2>>=20
</FONT></BODY></HTML>

------=_NextPart_000_000A_01C3F92B.509BBEC0--

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.