M
Mad Scientist Jr
my login user control has this public property, passed from the calling
page:
Public TableContent As Table
is this byref? if not how can it be made so?
when the user logs in, the user control calls a content object to show
or hide rows in TableContent
However, it doesn't seem to be working - the rows are not getting
shown/hidden when the user clicks the Login button on the user control.
The rows get shown/hidden on the next postback, but I'm pretty sure
this is the calling page itself which also calls the content object on
page load. My guess is the TableContent isn't getting passed back from
the user control, which could be the public property being not byref?
much appreciated...
btw The Content object show/hide method is something like
Public Shared Sub ShowHideContent(ByRef TableContent As Table,
ByVal GuestAccess as Boolean, ByVal FullAccess as Boolean)
....
For iLoopInner = 0 To ContentTable.Rows.Count - 1
sName = NextTable.Rows(iLoopInner).ID
If Left(sName, 5) = "Guest" Then
If GuestAccess Then
ContentTable.Rows(iLoopInner).Visible = True
Else
If InStr(sName, "HideIfNoAccess=1") > 0 Then
ContentTable.Rows(iLoopInner).Visible =
False
Else
DisableHyperlinks(ContentTable.Rows(iLoopInner), "(Login required)")
End If
End If
End If
If Left(sName, 5) = "Full_" Then
If FullAccess Then
ContentTable.Rows(iLoopInner).Visible = True
Else
If InStr(sName, "HideIfNoAccess=1") > 0 Then
ContentTable.Rows(iLoopInner).Visible =
False
Else
DisableHyperlinks(ContentTable.Rows(iLoopInner), "(Full membership
required)")
End If
End If
End If
Next ' For iLoopInner = 0 To ContentTable.Rows.Count - 1
....
Private Shared Sub DisableHyperlinks(ByRef NextRow As TableRow,
ByVal sNoAccessText As String)
Dim tColNext As TableCell
Dim NextControl As Control
For Each tColNext In NextRow.Cells
For Each NextControl In tColNext.Controls
If NextControl.GetType.ToString =
"System.Web.UI.WebControls.HyperLink" Then
CType(NextControl, HyperLink).Text = sNoAccessText
CType(NextControl, HyperLink).NavigateUrl = ""
End If
Next
Next
End Sub ' DisableHyperlinks
page:
Public TableContent As Table
is this byref? if not how can it be made so?
when the user logs in, the user control calls a content object to show
or hide rows in TableContent
However, it doesn't seem to be working - the rows are not getting
shown/hidden when the user clicks the Login button on the user control.
The rows get shown/hidden on the next postback, but I'm pretty sure
this is the calling page itself which also calls the content object on
page load. My guess is the TableContent isn't getting passed back from
the user control, which could be the public property being not byref?
much appreciated...
btw The Content object show/hide method is something like
Public Shared Sub ShowHideContent(ByRef TableContent As Table,
ByVal GuestAccess as Boolean, ByVal FullAccess as Boolean)
....
For iLoopInner = 0 To ContentTable.Rows.Count - 1
sName = NextTable.Rows(iLoopInner).ID
If Left(sName, 5) = "Guest" Then
If GuestAccess Then
ContentTable.Rows(iLoopInner).Visible = True
Else
If InStr(sName, "HideIfNoAccess=1") > 0 Then
ContentTable.Rows(iLoopInner).Visible =
False
Else
DisableHyperlinks(ContentTable.Rows(iLoopInner), "(Login required)")
End If
End If
End If
If Left(sName, 5) = "Full_" Then
If FullAccess Then
ContentTable.Rows(iLoopInner).Visible = True
Else
If InStr(sName, "HideIfNoAccess=1") > 0 Then
ContentTable.Rows(iLoopInner).Visible =
False
Else
DisableHyperlinks(ContentTable.Rows(iLoopInner), "(Full membership
required)")
End If
End If
End If
Next ' For iLoopInner = 0 To ContentTable.Rows.Count - 1
....
Private Shared Sub DisableHyperlinks(ByRef NextRow As TableRow,
ByVal sNoAccessText As String)
Dim tColNext As TableCell
Dim NextControl As Control
For Each tColNext In NextRow.Cells
For Each NextControl In tColNext.Controls
If NextControl.GetType.ToString =
"System.Web.UI.WebControls.HyperLink" Then
CType(NextControl, HyperLink).Text = sNoAccessText
CType(NextControl, HyperLink).NavigateUrl = ""
End If
Next
Next
End Sub ' DisableHyperlinks