473,403 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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

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

Mar 22 '06 #1
0 946

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Zurer | last post by:
Hello all, I want to load an in-memory XmlDocument from the server to the client and create an XMLDOM object using javascript. I can do it from a url by calling this Javascript from the...
0
by: Richard Myers | last post by:
Howdy, Im setting the imageUrl of a templated column of a datagrid in the ItemCreated event. The image changes depending on the status of a customer record being displayed in the grid....
3
by: Stu | last post by:
Hi, I am creating a control in a PlaceHolder like so: Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim ctrl As...
19
by: Siobhan | last post by:
Hi What is the recommended way to store a user's database credentials across the pages of a web application so that each time the database is accessed the system doesn't have to ask them for their...
5
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
3
by: idletask | last post by:
I have an application that has many windows. One window is used for order processing. I would like this window to display the other users who are also performing order processing (the idea is to...
0
ADezii
by: ADezii | last post by:
Most Access Users realize that Recordsets, being virtual representations of a Query, Table, or SQL Statement, exist only in our PC's memory. They, and the data they contain, literally exist at one...
1
by: Nikron | last post by:
Hi, I'm having an issue with the ASP.NET 2.0 Treeview control and persisting its' state accross requests. My Control is embedded within a master page and is used for site navigation. My problem...
1
by: Ronny | last post by:
I have a form which contains some panels and controls. Regarding a certain control (a picture box), I need that the ratio of its 2 dimensions remain constant when the user modifies the form size...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.