Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > persisting changes to a control outside a user control from the user control?

Reply
Thread Tools

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

 
 
Mad Scientist Jr
Guest
Posts: n/a
 
      03-22-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pix 506e w/5 static outside IPs - How to create a rule to allow ALL tcp/udp traffic from one outside IP to an internal IP (for an internal router/NAT with it's own subnet) kyoo Cisco 22 04-12-2008 03:37 PM
help with pix inside->outside + dmz->outside + inside->outside->dmz Jack Cisco 0 09-19-2007 01:57 AM
CallForward outside->inside->outside failed after one ring. Yogz Cisco 1 04-16-2007 03:58 PM
Issues Persisting Design time changes to page source jebecker@_NO_SPAM_.pointroll.com ASP .Net Building Controls 1 07-14-2006 02:38 PM
nat from outside to outside dt1649651@yahoo.com Cisco 1 08-21-2005 04:26 PM



Advertisments