C
Chris
Hi,
I tried to create a class which must change the propety 'visible' of a
<link> tag in the masterpage into 'false' when the user is logged. But i get
the error: "Object reference not set to an instance of an object"
for the line 'If mpg.FindControl("lkred").Visible = True Then'.
I couldn't find sofar the solution.
Any help would be appreciated ...
Thanks
Chris
the class:
---------
Imports Microsoft.VisualBasic
Public Class loginkl
Public Sub logkl()
Dim pg As New Page
Dim mpg As MasterPage
If pg.User.Identity.IsAuthenticated = True Then
If mpg.FindControl("lkred").Visible = True Then
....
End If
End Sub
End Class
code-behind:
-----------
Partial Class MasterPage
Inherits System.Web.UI.MasterPage
Protected Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Init
Dim lg As New loginkl
lg.logkl()
End Sub
End Class
masterpage.master:
I tried to create a class which must change the propety 'visible' of a
<link> tag in the masterpage into 'false' when the user is logged. But i get
the error: "Object reference not set to an instance of an object"
for the line 'If mpg.FindControl("lkred").Visible = True Then'.
I couldn't find sofar the solution.
Any help would be appreciated ...
Thanks
Chris
the class:
---------
Imports Microsoft.VisualBasic
Public Class loginkl
Public Sub logkl()
Dim pg As New Page
Dim mpg As MasterPage
If pg.User.Identity.IsAuthenticated = True Then
If mpg.FindControl("lkred").Visible = True Then
....
End If
End Sub
End Class
code-behind:
-----------
Partial Class MasterPage
Inherits System.Web.UI.MasterPage
Protected Sub Page_Init(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Init
Dim lg As New loginkl
lg.logkl()
End Sub
End Class
masterpage.master: