Webcontrols added inside a Gridview are not accessible from code behind.

Discussion in 'ASP .Net Web Controls' started by cclements1384@gmail.com, Oct 26, 2007.

  1. Guest

    Gurus,

    I am trying to add a Drop Down List web control to the footer template
    of a grid view. The problem is that once the control is created
    (using markup) the name of the control is not accessible from the
    page's code behind.

    References to ddlmyControl in code fail to compile because the name is
    not defined.

    If I simply move the control out of the grid view, the control's
    properties become accessible from the code behind and the application
    compiles just fine.

    I can't even find the partial class file to see if the controls are
    getting added by the IDE (I suspect that is the problem) can anyone
    provide me some advice?

    Chris Clements
     
    , Oct 26, 2007
    #1
    1. Advertising

  2. Guest

    Nevermind guys, I would need to access the properties of a control in
    the databound using the fndcontrol method.
    Sorry for the waste of bandwidth.

    Chris

    On Oct 26, 4:21 pm, wrote:
    > Gurus,
    >
    > I am trying to add a Drop Down List web control to the footer template
    > of a grid view. The problem is that once the control is created
    > (using markup) the name of the control is not accessible from the
    > page's code behind.
    >
    > References to ddlmyControl in code fail to compile because the name is
    > not defined.
    >
    > If I simply move the control out of the grid view, the control's
    > properties become accessible from the code behind and the application
    > compiles just fine.
    >
    > I can't even find the partial class file to see if the controls are
    > getting added by the IDE (I suspect that is the problem) can anyone
    > provide me some advice?
    >
    > Chris Clements
     
    , Oct 26, 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. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    589
    Alphonse Giambrone
    Jun 28, 2003
  2. John Saunders
    Replies:
    0
    Views:
    540
    John Saunders
    Jul 1, 2004
  3. keithb
    Replies:
    1
    Views:
    916
    Bruce Barker
    Mar 29, 2006
  4. Pete Mahoney

    Postback for DataGrid Columns Added in Code Behind not firing.

    Pete Mahoney, Aug 30, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    185
    Raghavendra T V
    Aug 31, 2004
  5. Cathy

    Dynamically Added User Control not accessible!

    Cathy, Dec 16, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    126
    Cathy
    Dec 16, 2003
Loading...

Share This Page