473,769 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Ro ws.Count - 1
sName = NextTable.Rows( iLoopInner).ID

If Left(sName, 5) = "Guest" Then
If GuestAccess Then
ContentTable.Ro ws(iLoopInner). Visible = True
Else
If InStr(sName, "HideIfNoAccess =1") > 0 Then
ContentTable.Ro ws(iLoopInner). Visible =
False
Else

DisableHyperlin ks(ContentTable .Rows(iLoopInne r), "(Login required)")
End If
End If
End If

If Left(sName, 5) = "Full_" Then
If FullAccess Then
ContentTable.Ro ws(iLoopInner). Visible = True
Else
If InStr(sName, "HideIfNoAccess =1") > 0 Then
ContentTable.Ro ws(iLoopInner). Visible =
False
Else

DisableHyperlin ks(ContentTable .Rows(iLoopInne r), "(Full membership
required)")
End If
End If
End If
Next ' For iLoopInner = 0 To ContentTable.Ro ws.Count - 1
....

Private Shared Sub DisableHyperlin ks(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.Contro ls
If NextControl.Get Type.ToString =
"System.Web.UI. WebControls.Hyp erLink" Then
CType(NextContr ol, HyperLink).Text = sNoAccessText
CType(NextContr ol, HyperLink).Navi gateUrl = ""
End If
Next
Next
End Sub ' DisableHyperlin ks

Mar 22 '06 #1
0 962

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

Similar topics

3
4279
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 client. var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.load("url of the persisted file");
0
883
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. Somethings i cant validate for on the client and do so instead on the server. If an input is invalid i post pack to client. However because the user interacts with the grid i dont rebind when i postback and so consequently the item created event is not...
3
2270
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 AcceptOrCancel = CType(Page.LoadControl("controls/AcceptOrCancel.ascx"), AcceptOrCancel) PlaceHolder1.Controls.Add(ctrl)
19
2545
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 username and password again We have previously stored these in a session variable (encrypted) and retrieved from their - but are worried about the impact on performance if the number of users increases. Had thought about cookies but worried...
5
4838
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 automatically if the data doesn't change. But if records have been added or deleted then it looks as if some code is necessary: I've done this by using GridView.SelectedValue to get the key value of the currently selected Row and then by itterating...
3
1268
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 prevent a user from opening an order that is being worked on by another user. I have considered using the database: * my query can return a user id or other identifier along with the order record so that when I populate my list view control,...
0
11312
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 specific moment in time - then gone the next. Few of us realize, however, that they can be saved to disk and later retrieved to will. The technical jargon for this is called 'Persisting a Recordset' and I'll show you how it can be done. ADO has this...
1
3602
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 is that the user wants to know which page they are currently on and therefore I need to highlight the selected node. The problem is I lose state whenever the user selects a node and is redirected to another page. Thanks in advance
1
1303
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 (the other control may compensate for that). Is that possible and how? Regards Ronny
0
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9415
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10198
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10032
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9978
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9848
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5432
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.