Re: Findcontrol problem

Discussion in 'ASP .Net' started by Patrice, Jul 16, 2007.

  1. Patrice

    Patrice Guest

    Not necessarily (FindControl search in the current naming container). As you
    didn't mentioned anything in your code, it search in the page container and
    it's likely your control is declared actually in a inner container (else you
    coud directly use the variable name of course).

    Try MyContainer.FindControl instead...

    --
    Patrice


    "kpg" <> a écrit dans le message de news:
    Xns996F7C4487EA3ipostthereforeiam@207.46.248.16...
    > InASP.NET 2.0 I have a checkbox named CB1
    >
    > <asp:CheckBox ID="CB1" runat="server" />
    >
    > In the Page_Load event:
    >
    > dim cb as checkbox
    > cb = ctype(findcontrol("CB1"), checkbox)
    >
    > but cb = nothing
    >
    > Am I going crazy? This should work, right?
    >
    > tia
    > kpg
     
    Patrice, Jul 16, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jaime

    FindControl problem

    Jaime, May 20, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    691
    Jaime
    May 20, 2005
  2. =?Utf-8?B?dHBhcmtzNjk=?=

    ItemCreated FindControl problem c#

    =?Utf-8?B?dHBhcmtzNjk=?=, Jun 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    6,547
    =?Utf-8?B?QkVMSVVT?=
    Jun 16, 2005
  3. Arjen

    Findcontrol problem

    Arjen, Oct 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,060
    Scott Allen
    Oct 18, 2005
  4. ThunderMusic
    Replies:
    2
    Views:
    432
    ThunderMusic
    Oct 9, 2006
  5. Terry

    problem with FindControl

    Terry, Feb 15, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    600
    Terry
    Feb 15, 2007
Loading...

Share This Page