Re: FindControl

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: tma (tma_at_allisconfusing.net)
Date: 08/09/04


Date: Mon, 9 Aug 2004 07:59:21 -0500

This what I'm trying to do:

Dim chkEqmtRental As WebControls.CheckBox

chkEqmtRental = plh.FindControl("chkEqmtRental")

If chkEqmtRental.Checked Then

...some code...

End If

Presently, the chkEqmtRental.Checked always evaluates to FALSE.

"Kevin Spencer" <kspencer@takempis.com> wrote in message
news:Ok9gD2gfEHA.632@TK2MSFTNGP12.phx.gbl...
> You code below assigns the checkbox (assuming it is found) to a variable.
As
> Checked is a property of the checkbox, you should have no trouble
accessing
> it. So, you might want to explain what you're trying to say.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "tma" <tma@allisconfusing.net> wrote in message
> news:eRU3VrgfEHA.3200@TK2MSFTNGP09.phx.gbl...
> > My code below returns the .text property of the chkEqmtRental check box
> but
> > not it's checked state. I'm creating the control in a placeholder and
need
> > to access the check box in the codebehind. Also, is it possible to
access
> > events for that control and if so, how?
> > chkEqmtRental = plh.FindControl("chkEqmtRental")
> >
> >
> >
> >
> >
> >
>
>



Relevant Pages

  • Re: ASP .NET vs. ASP
    ... As Lau Lei Cheong states in the next message, there is the checkbox list ... let's assume you're using a textbox which has no list class (so life ... you need to put a placeholder on the webpage. ... So even if you did not know the name of a control, ...
    (microsoft.public.dotnet.framework.aspnet)
  • scrollTop property
    ... I have the following control hierarchy dynamically generated on the ... A number of hierarical checkbox controls are added to a Placeholder ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: FindControl
    ... I think that the problem is there because you don't cast the finded control ... Dim chkEqmtRental as CheckBox = CType, ... chkEqmtRental.Checked 'for checked state ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DateTimePicker + CheckBox bug.
    ... The checkbox DOES change from the ... unchecked state to the checked state. ... is a part of the control, and even through reflection I can't seem to ... > because the listbox will not trigger a SeletionChanged event. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • FindControl
    ... not it's checked state. ... I'm creating the control in a placeholder and need ... to access the check box in the codebehind. ...
    (microsoft.public.dotnet.framework.aspnet)