Hi,
I have a loop running on Page_PreRender that sets a number of controls
to invisible based on a set of criteria. Before I do this however, I set all
of the drop down lists to be visible with a straightforward recursive loop.
Now - I'm really muddled by this - why does this:
If TypeOf Ctl Is DropDownList Then
Ctl.Visible = true
End If
Set the control to be INVISIBLE? How is this possible - I put a breakpoint
in at the first of these lines, evaluate ctl.visible, the debugger returns
"true", step forward one line, evaluate ctl.visible, still true, move on to
the third line, and now ctl.visible = false !!!!! How is this possible? Can
someone please help me? For now, I've created a css class called "invisible"
which uses css to set the control to invisible, but the effect isn't the
same and it's going to make the page a whole bunch bigger.
Any ideas?
Nick 6 2014
I for one, need more context to solve this one...like seeing more of the
code...
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Nick Stansbury" <ni************@sage-removepartners.com> wrote in message
news:Or**************@TK2MSFTNGP09.phx.gbl... Hi,
I have a loop running on Page_PreRender that sets a number of controls to invisible based on a set of criteria. Before I do this however, I set
all of the drop down lists to be visible with a straightforward recursive
loop. Now - I'm really muddled by this - why does this: If TypeOf Ctl Is DropDownList Then Ctl.Visible = true End If Set the control to be INVISIBLE? How is this possible - I put a breakpoint in at the first of these lines, evaluate ctl.visible, the debugger returns "true", step forward one line, evaluate ctl.visible, still true, move on
to the third line, and now ctl.visible = false !!!!! How is this possible?
Can someone please help me? For now, I've created a css class called
"invisible" which uses css to set the control to invisible, but the effect isn't the same and it's going to make the page a whole bunch bigger. Any ideas? Nick
Hi,
The problem occurs in a custom page class here are the relevant
snippets:
Public Class Standard : Inherits System.Web.UI.Page
Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
ResolveDivDDLOverlayConflicts()
End Sub
Private Sub ResolveDivDDLOverlayConflicts()
'first set all Drop down lists to visible before performing analysis
For each ctl as Control in me.controls
_RecursivelySetDDLVisibility(Ctl, True)
next
End Sub
Private Sub _RecursivelySetDDLVisibility(ByVal Control as Control, ByVal
Visibility as boolean)
If TypeOf Control is DropDownList then 'Line A
Control.visible = Visibility 'Line B
end if 'Line C
For each SubControl in Control.Controls
_RecursivelySetDDLVisibility(SubControl, Visibility)
next
End Sub
So if I step through this and evaluate Control.Visible on the Line's marked
A,B & C then at A it's marked as true, at B it's marked at true (because B
hasn't yet been run) but at C it evaluates to false! And what's more if I
then in the immediate window I try to set it to true and then evaluate it
it's still false!
Nick
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... I for one, need more context to solve this one...like seeing more of the code...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to come!)
"Nick Stansbury" <ni************@sage-removepartners.com> wrote in message news:Or**************@TK2MSFTNGP09.phx.gbl... Hi,
I have a loop running on Page_PreRender that sets a number of
controls to invisible based on a set of criteria. Before I do this however, I set all of the drop down lists to be visible with a straightforward recursive loop. Now - I'm really muddled by this - why does this: If TypeOf Ctl Is DropDownList Then Ctl.Visible = true End If Set the control to be INVISIBLE? How is this possible - I put a
breakpoint in at the first of these lines, evaluate ctl.visible, the debugger
returns "true", step forward one line, evaluate ctl.visible, still true, move on
to the third line, and now ctl.visible = false !!!!! How is this possible? Can someone please help me? For now, I've created a css class called "invisible" which uses css to set the control to invisible, but the effect isn't the same and it's going to make the page a whole bunch bigger. Any ideas? Nick
The code works fine for me...
are there shared variables at play?
Have you tried your code with a simple page? I just had a single
dropdownlist inside my form...
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Nick Stansbury" <ni************@sage-removepartners.com> wrote in message
news:uC**************@tk2msftngp13.phx.gbl... Hi,
The problem occurs in a custom page class here are the relevant snippets:
Public Class Standard : Inherits System.Web.UI.Page
Protected Overrides Sub OnPreRender(ByVal e As EventArgs) ResolveDivDDLOverlayConflicts() End Sub
Private Sub ResolveDivDDLOverlayConflicts() 'first set all Drop down lists to visible before performing analysis For each ctl as Control in me.controls _RecursivelySetDDLVisibility(Ctl, True) next End Sub
Private Sub _RecursivelySetDDLVisibility(ByVal Control as Control, ByVal Visibility as boolean) If TypeOf Control is DropDownList then 'Line A Control.visible = Visibility 'Line B end if 'Line C For each SubControl in Control.Controls _RecursivelySetDDLVisibility(SubControl, Visibility) next End Sub
So if I step through this and evaluate Control.Visible on the Line's
marked A,B & C then at A it's marked as true, at B it's marked at true (because B hasn't yet been run) but at C it evaluates to false! And what's more if I then in the immediate window I try to set it to true and then evaluate it it's still false!
Nick
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... I for one, need more context to solve this one...like seeing more of the code...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to come!)
"Nick Stansbury" <ni************@sage-removepartners.com> wrote in
message news:Or**************@TK2MSFTNGP09.phx.gbl... Hi,
I have a loop running on Page_PreRender that sets a number of controls to invisible based on a set of criteria. Before I do this however, I
set all of the drop down lists to be visible with a straightforward recursive loop. Now - I'm really muddled by this - why does this: If TypeOf Ctl Is DropDownList Then Ctl.Visible = true End If Set the control to be INVISIBLE? How is this possible - I put a breakpoint in at the first of these lines, evaluate ctl.visible, the debugger returns "true", step forward one line, evaluate ctl.visible, still true, move
on to the third line, and now ctl.visible = false !!!!! How is this
possible? Can someone please help me? For now, I've created a css class called "invisible" which uses css to set the control to invisible, but the effect isn't
the same and it's going to make the page a whole bunch bigger. Any ideas? Nick
Not sure what you mean when you refer to "shared variables at play" - could
you clarify?
Not as simple as you mentioned - I actually try it with a single user
control on a single page, with a single drop down list and a bunch of text
boxes - I'll try it without the user control.
Any other suggestions?
Nick
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... The code works fine for me...
are there shared variables at play?
Have you tried your code with a simple page? I just had a single dropdownlist inside my form...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to come!) "Nick Stansbury" <ni************@sage-removepartners.com> wrote in message news:uC**************@tk2msftngp13.phx.gbl... Hi,
The problem occurs in a custom page class here are the relevant snippets:
Public Class Standard : Inherits System.Web.UI.Page
Protected Overrides Sub OnPreRender(ByVal e As EventArgs) ResolveDivDDLOverlayConflicts() End Sub
Private Sub ResolveDivDDLOverlayConflicts() 'first set all Drop down lists to visible before performing analysis For each ctl as Control in me.controls _RecursivelySetDDLVisibility(Ctl, True) next End Sub
Private Sub _RecursivelySetDDLVisibility(ByVal Control as Control, ByVal Visibility as boolean) If TypeOf Control is DropDownList then 'Line A Control.visible = Visibility 'Line B end if 'Line C For each SubControl in Control.Controls _RecursivelySetDDLVisibility(SubControl, Visibility) next End Sub
So if I step through this and evaluate Control.Visible on the Line's marked A,B & C then at A it's marked as true, at B it's marked at true (because
B hasn't yet been run) but at C it evaluates to false! And what's more if
I then in the immediate window I try to set it to true and then evaluate
it it's still false!
Nick
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... I for one, need more context to solve this one...like seeing more of
the code...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to come!)
"Nick Stansbury" <ni************@sage-removepartners.com> wrote in message news:Or**************@TK2MSFTNGP09.phx.gbl... > Hi, > > I have a loop running on Page_PreRender that sets a number of
controls > to invisible based on a set of criteria. Before I do this however, I set all > of the drop down lists to be visible with a straightforward
recursive loop. > > Now - I'm really muddled by this - why does this: > If TypeOf Ctl Is DropDownList Then > Ctl.Visible = true > End If > Set the control to be INVISIBLE? How is this possible - I put a breakpoint > in at the first of these lines, evaluate ctl.visible, the debugger returns > "true", step forward one line, evaluate ctl.visible, still true,
move on to > the third line, and now ctl.visible = false !!!!! How is this possible? Can > someone please help me? For now, I've created a css class called "invisible" > which uses css to set the control to invisible, but the effect isn't the > same and it's going to make the page a whole bunch bigger. > Any ideas? > Nick > >
I mean do you have any variables declared as shared that this code relies
on?
public shared someValue as Control or something where someValue is used in
the code?
Karl
--
MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Nick Stansbury" <ni************@sage-removepartners.com> wrote in message
news:uh**************@TK2MSFTNGP15.phx.gbl... Not sure what you mean when you refer to "shared variables at play" -
could you clarify?
Not as simple as you mentioned - I actually try it with a single user control on a single page, with a single drop down list and a bunch of text boxes - I'll try it without the user control.
Any other suggestions?
Nick "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... The code works fine for me...
are there shared variables at play?
Have you tried your code with a simple page? I just had a single dropdownlist inside my form...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to come!) "Nick Stansbury" <ni************@sage-removepartners.com> wrote in
message news:uC**************@tk2msftngp13.phx.gbl... Hi,
The problem occurs in a custom page class here are the relevant snippets:
Public Class Standard : Inherits System.Web.UI.Page
Protected Overrides Sub OnPreRender(ByVal e As EventArgs) ResolveDivDDLOverlayConflicts() End Sub
Private Sub ResolveDivDDLOverlayConflicts() 'first set all Drop down lists to visible before performing
analysis For each ctl as Control in me.controls _RecursivelySetDDLVisibility(Ctl, True) next End Sub
Private Sub _RecursivelySetDDLVisibility(ByVal Control as Control,
ByVal Visibility as boolean) If TypeOf Control is DropDownList then 'Line A Control.visible = Visibility 'Line B end if 'Line C For each SubControl in Control.Controls _RecursivelySetDDLVisibility(SubControl, Visibility) next End Sub
So if I step through this and evaluate Control.Visible on the Line's marked A,B & C then at A it's marked as true, at B it's marked at true
(because B hasn't yet been run) but at C it evaluates to false! And what's more
if I then in the immediate window I try to set it to true and then evaluate it it's still false!
Nick
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... > I for one, need more context to solve this one...like seeing more of the > code... > > Karl > > -- > MY ASP.Net tutorials > http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) > http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more
to > come!) > > > "Nick Stansbury" <ni************@sage-removepartners.com> wrote in message > news:Or**************@TK2MSFTNGP09.phx.gbl... > > Hi, > > > > I have a loop running on Page_PreRender that sets a number of controls > > to invisible based on a set of criteria. Before I do this however,
I set > all > > of the drop down lists to be visible with a straightforward recursive > loop. > > > > Now - I'm really muddled by this - why does this: > > If TypeOf Ctl Is DropDownList Then > > Ctl.Visible = true > > End If > > Set the control to be INVISIBLE? How is this possible - I put a breakpoint > > in at the first of these lines, evaluate ctl.visible, the debugger returns > > "true", step forward one line, evaluate ctl.visible, still true, move on > to > > the third line, and now ctl.visible = false !!!!! How is this possible? > Can > > someone please help me? For now, I've created a css class called > "invisible" > > which uses css to set the control to invisible, but the effect
isn't the > > same and it's going to make the page a whole bunch bigger. > > Any ideas? > > Nick > > > > > >
Hi,
No - nothing like this.
Thanks for your help Karl - I'm going to call this strugle a day and leave
it. If I get to the bottom of it I'll post a solution (and a cause) back
here
Nick
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uO**************@TK2MSFTNGP09.phx.gbl... I mean do you have any variables declared as shared that this code relies on?
public shared someValue as Control or something where someValue is used in the code?
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to come!) "Nick Stansbury" <ni************@sage-removepartners.com> wrote in message news:uh**************@TK2MSFTNGP15.phx.gbl... Not sure what you mean when you refer to "shared variables at play" - could you clarify?
Not as simple as you mentioned - I actually try it with a single user control on a single page, with a single drop down list and a bunch of
text boxes - I'll try it without the user control.
Any other suggestions?
Nick "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... The code works fine for me...
are there shared variables at play?
Have you tried your code with a simple page? I just had a single dropdownlist inside my form...
Karl
-- MY ASP.Net tutorials http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to come!) "Nick Stansbury" <ni************@sage-removepartners.com> wrote in message news:uC**************@tk2msftngp13.phx.gbl... > Hi, > > The problem occurs in a custom page class here are the relevant > snippets: > > Public Class Standard : Inherits System.Web.UI.Page > > Protected Overrides Sub OnPreRender(ByVal e As EventArgs) > ResolveDivDDLOverlayConflicts() > End Sub > > Private Sub ResolveDivDDLOverlayConflicts() > 'first set all Drop down lists to visible before performing analysis > For each ctl as Control in me.controls > _RecursivelySetDDLVisibility(Ctl, True) > next > End Sub > > Private Sub _RecursivelySetDDLVisibility(ByVal Control as Control, ByVal > Visibility as boolean) > If TypeOf Control is DropDownList then 'Line A > Control.visible = Visibility 'Line B > end if 'Line C > For each SubControl in Control.Controls > _RecursivelySetDDLVisibility(SubControl, Visibility) > next > End Sub > > So if I step through this and evaluate Control.Visible on the Line's marked > A,B & C then at A it's marked as true, at B it's marked at true (because B > hasn't yet been run) but at C it evaluates to false! And what's more if I > then in the immediate window I try to set it to true and then
evaluate it > it's still false! > > Nick > > "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> > wrote in message news:%2****************@TK2MSFTNGP15.phx.gbl... > > I for one, need more context to solve this one...like seeing more
of the > > code... > > > > Karl > > > > -- > > MY ASP.Net tutorials > > http://www.openmymind.net/ - New and Improved (yes, the popup is annoying) > > http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ
(more to > > come!) > > > > > > "Nick Stansbury" <ni************@sage-removepartners.com> wrote in message > > news:Or**************@TK2MSFTNGP09.phx.gbl... > > > Hi, > > > > > > I have a loop running on Page_PreRender that sets a number
of > controls > > > to invisible based on a set of criteria. Before I do this
however, I set > > all > > > of the drop down lists to be visible with a straightforward recursive > > loop. > > > > > > Now - I'm really muddled by this - why does this: > > > If TypeOf Ctl Is DropDownList Then > > > Ctl.Visible = true > > > End If > > > Set the control to be INVISIBLE? How is this possible - I put a > breakpoint > > > in at the first of these lines, evaluate ctl.visible, the
debugger > returns > > > "true", step forward one line, evaluate ctl.visible, still true, move on > > to > > > the third line, and now ctl.visible = false !!!!! How is this possible? > > Can > > > someone please help me? For now, I've created a css class called > > "invisible" > > > which uses css to set the control to invisible, but the effect
isn't the > > > same and it's going to make the page a whole bunch bigger. > > > Any ideas? > > > Nick > > > > > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Roman |
last post by:
I have built a simple user control that contains 2 buttons, a text box and a
dropdownlist. When a button is clicked it sets the visible property
of the textbox/dropdownlist and the button. ie the...
|
by: Michel |
last post by:
Hi,
I have written a custom control, which I use on 2 ASP.NET pages.
The strange part of it : on the one page, it is displayed correctly,
in the second it is not displayed.
When I take a look...
|
by: Amber |
last post by:
The DataGrid allows you to make columns visible or invisible on demand
- even edit and other special columns. This article will show you how
it is done.
Some developers have reported problems...
|
by: John Holmes |
last post by:
I would like to turn on a label control in javascript with the onfocus event
of another control by setting the Visible property to true. When I try and
reference this label control it says...
|
by: Roman |
last post by:
I have built a simple user control that contains 2 buttons, a text box and a
dropdownlist. When a button is clicked it sets the visible property
of the textbox/dropdownlist and the button. ie the...
| |
by: Keith |
last post by:
I have a repeater control that contains a HeaderTemplate and an ItemTemplate.
Each item contains a checkbox with an ID of chkReconciled, and the header
contains a single checkbox with an ID of...
|
by: -D- |
last post by:
How can I turn the visibility of the xml control on or off?
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="TopNavBar.ascx.cs" Inherits="compass.user_controls.TopNavBar"...
|
by: kevin.vaughan |
last post by:
Good Afternoon Everyone,
Could someone please explain why I can't set the Subform control
Visible attribute to False as below?
The statement for the locked attributes work but not for the...
|
by: Doc John |
last post by:
I have an MDI container with a child Form which will be visible according to
certain events. The problem is that when I set the property Visible to False
and then back to True, the Form will be in...
|
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,...
|
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...
| |
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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: 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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |