Re: Use Form Authentication to control visibility of tag for logged-in users

It looks as if the Context User Idenetity is lost when viewing from

<liuhang@xxxxxxxxx> wrote in message
Hi, guys,

I'm trying to migrate one of my application written in .NET 1.1 to the
new 2.0, and keep the Form type Authentication for the login part,
which should only show the LogOff tag on the banner to logged-in users.
Currently I'm having problem to show the LogOff tab after valid user
login. It works fine when I browse it using "View In Browser" in my
VS2005, but if i open a new IE and start from localhost, it doesn't
work. The code of the authentication part in my Banner.ascx.vb looks

...... ......
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim tabItems As New ArrayList

If Request.IsAuthenticated = True Then
' If isAuthenticated add log tab
' add the Log tab (all users can see this tab)
... ...

tabItems.Add(New TabItem("Other",
"otherPage.aspx?index=" & tabItems.Count))
tabItems.Add(New TabItem("Help", "ctnHelp.aspx?index="
& tabItems.Count))
...... ......
End If

'Show log off button if user is form authenticated
If Context.User.Identity.AuthenticationType Is "Forms" Then
LogOff.Visible = True
End If

and in my web.config I've included:

<authentication mode="Forms">
<forms name=".ASPXAUTH" protection="All" timeout="60"
<identity impersonate="true"/>

Is it related to the configuration of ASP.NET 2.0 security in IIS, and
even cookies? I've searched on Google and still cann't find an answer
so far. Does any of you have idea what the problem could be and how
should I overcome it?

TIA. Alan