Placeholder issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tma

    Placeholder issue

    How do I reference controls added via the placeholder control in my
    codebehind file?

    For example, my placeholder adds a checkbox with an id="chkGear". How do I
    test for the checkstate of chkgear in code?

    Thanks!


  • Lucas Tam

    #2
    Re: Placeholder issue

    "tma" <tma@allisconfu sing.net> wrote in
    news:#XVauxbfEH A.3016@tk2msftn gp13.phx.gbl:
    [color=blue]
    > How do I reference controls added via the placeholder control in my
    > codebehind file?
    >
    > For example, my placeholder adds a checkbox with an id="chkGear". How
    > do I test for the checkstate of chkgear in code?[/color]


    Use the FindControl method to get a reference to the control.

    --
    Lucas Tam (REMOVEnntp@rog ers.com)
    Please delete "REMOVE" from the e-mail address when replying.

    Comment

    • Scott Allen

      #3
      Re: Placeholder issue

      Hi tma,

      If you are dynamically creating and adding those controls, you should
      store a reference to them in a class field, where you will find the
      other ASP.NET controls.

      --
      Scott


      On Sun, 8 Aug 2004 21:56:11 -0500, "tma" <tma@allisconfu sing.net>
      wrote:
      [color=blue]
      >How do I reference controls added via the placeholder control in my
      >codebehind file?
      >
      >For example, my placeholder adds a checkbox with an id="chkGear". How do I
      >test for the checkstate of chkgear in code?
      >
      >Thanks!
      >[/color]

      Comment

      Working...