persisting changes to a control outside a user control from the user control?

persisting changes to a control outside a user control from the user control?

Post by Mad Scient » Thu, 23 Mar 2006 17:02:46


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
 
 
 

1. How to permit user B to edit user A's meeting, Public Folder

2. Moving User A's E-Mail to User B's in Exchange2003

I'm running SBS2003 RC2 Exchange2003, how do I move User A's Outlook e-mail
contents to User B's?

Everything else relating to User A is done via distribution groups so their
are no problems there. It's just all the old contents of User A's inbox I
need.

I don't want to rename User A to User B. And I want to avoid have to export
a .PST from User A's Outlook.

There must be a magic Exchange button to make this change painless?

Thanks all.

3. using controls in user control as control parameters on parent page

4. Dropping controls in a User Control ges added to parent control

5. using controls in user control as control parameters on parent

6. Traversing children controls of user control get extra controls

7. using controls in user control as control parameters on parent pag

8. ASP.NET Templated User Controls - Limit child controls allowable within a templated control

9. Controls.Add() for a Web User Control doesn't instansiate its child controls

10. Dynamic Controls in User Control; page/control lifecycle question

11. Valve control - user controlled, then self controlled

12. Custom User Control is not rendered inside another user control in a server table.

13. Custom User Control is not rendered inside another user control in

14. Can User Control inherted from a User Controls?

15. Accessing USER CONTROL which is inside Masterpage through Another USER Control inside normal page.