FormView FindControl issue

Discussion in 'ASP .Net' started by Bryce, Aug 19, 2007.

  1. Bryce

    Bryce Guest

    ASP.net 2.0, using Visual Studio 2005

    Can't seem to figure out how to get a reference to a control in a FormView.

    I have tried the following code:
    Control list = ArticleDetailView.FindControl("IssueYearDropDown");

    during several event handlers, including FormLoad,
    ArticleDetailView_DataBinding, ArticleDetailView_ModeChanged
    (ArticleDetailView is the FormView). It always returns null.

    The Control is a DropDownList, and is specified in the InsertItemTemplate.

    Thanks
    Bryce, Aug 19, 2007
    #1
    1. Advertising

  2. Bryce

    Bryce Guest

    To answer my own question, I just searched for the control in the handler
    that brought up the InsertItemTemplate, and it found it there..

    Still trying to wrap my head around this stuff...

    "Bryce" <> wrote in message
    news:...
    > ASP.net 2.0, using Visual Studio 2005
    >
    > Can't seem to figure out how to get a reference to a control in a
    > FormView.
    >
    > I have tried the following code:
    > Control list = ArticleDetailView.FindControl("IssueYearDropDown");
    >
    > during several event handlers, including FormLoad,
    > ArticleDetailView_DataBinding, ArticleDetailView_ModeChanged
    > (ArticleDetailView is the FormView). It always returns null.
    >
    > The Control is a DropDownList, and is specified in the InsertItemTemplate.
    >
    > Thanks
    Bryce, Aug 19, 2007
    #2
    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. Zarn Bou via DotNetMonster.com

    FindControl in FormView

    Zarn Bou via DotNetMonster.com, Mar 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    2,874
    Zarn Bou via DotNetMonster.com
    Mar 16, 2005
  2. Paul Aspinall

    FormView - FindControl

    Paul Aspinall, Feb 25, 2006, in forum: ASP .Net
    Replies:
    14
    Views:
    38,586
  3. sck10
    Replies:
    2
    Views:
    5,033
    sck10
    Aug 28, 2006
  4. jobs
    Replies:
    0
    Views:
    402
  5. Mr. SweatyFinger

    findcontrol in a formview

    Mr. SweatyFinger, Dec 1, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    432
    Mr. SweatyFinger
    Dec 1, 2006
Loading...

Share This Page