Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I was create a login page to authenticate user. When user click on the "Login" button, it will post value to couple of profile.

 

Protected Sub LoginButton_Click(ByVal sender As Object, ByVal e As EventArgs)

 

Profile.SchoolID = "School001"

Profile.UserID = "A0001"

Profile.Role = "admin"

Profile.Save()

End Sub

 

I did set the DestinationPageUrl to my first page. I was using the master page with Navigation Menu. All of this if working, If a user is "admin" role and authenticated, then user will go to my first page(DestinationPageUrl) and get "admin" Menu.

 

My problem is when user click the Login button, the database have store this new profile value. But when it come to the DestinationPageUrl, it change my new profile value to my default value. The default value is set in web.config page. So, the "admin" user get the default "menu" since his role has change to normal user.

 

Web.config

<anonymousIdentification enabled="true"/>

<profile>

<properties>

<add name="SchoolID" defaultValue="EDU01" allowAnonymous="true"/>

<add name="UserID" defaultValue="ES000" allowAnonymous="true"/>

<add name="Role" defaultValue="user" allowAnonymous="true"/>

<add name="MyThemes" defaultValue="Default" allowAnonymous="true"/>

</properties>

</profile>

 

 

If anyone know what's wrong to my code?

 

Calvin

Posted

Problem Solved.

 

Solution: when you click your button you're not yet authenticated. You should try with the event loggedin :

 

Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn

 

Profile.xxx = xxx

Profile.Save()

 

 

End Sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...