jknj72
asked on
Master page login label
I have a Master page and on it is the user that is logged into the app. I am having trouble assigning a value to this label to the current user. I have a login page that when the user logs in the label on the Master should be updated. I have the label in an Update Panel to refresh everytime the user logs in but it still doesnt take the logged in users value. I have assign a property that I can set the value with from another page but that isnt working for me? This is the code in the master
I know Im screwing up somewhere but I just do not know where.
Any help would be appreciated
Thanks
JK
Public Property PageLabel() As String
Get
Return lblUser.Text
End Get
Set(value As String)
lblUser.Text = value
upUserLabel.Update()
End Set
End Property
And in my Login page I assign the username after I check the DB with thisSession("LoginLabel") = Session("UserRole") & " \ " & Session("UserName")
Me.Master.PageLabel = Session("LoginLabel")
I have added this in the Login pages markup<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/ItemMaster.Master" CodeBehind="UserLogin.aspx.vb" Inherits="CRIB_EAST.UserLogin" %>
<%@ MasterType VirtualPath="~/ItemMaster.Master" %>
I know Im screwing up somewhere but I just do not know where.
Any help would be appreciated
Thanks
JK
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was told back when I first put this code in that using the property Get and Set and <%@ MasterType VirtualPath="~/ItemMaster. Master" %> in the page I was setting from(Login page) that I could manipulate the label. When I hit the code
Me.Master.PageLabel = Session("LoginLabel")
It goes to the Master and sets the labels proprty it just doesnt show the value? Hope this makes sense
Me.Master.PageLabel = Session("LoginLabel")
It goes to the Master and sets the labels proprty it just doesnt show the value? Hope this makes sense
ASKER
put in the page load of master and page load of UserLogin page. Thanks for the help!
ASKER
Open in new window