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 whats wrong to my code?
Calvin
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 whats wrong to my code?
Calvin