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. Advertisements

  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. Advertisements

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:
    845
    Alphonse Giambrone
    Jun 28, 2003
  2. Alan Silver
    Replies:
    37
    Views:
    4,280
    Alan Silver
    Feb 10, 2005
  3. keithb
    Replies:
    1
    Views:
    1,202
    Bruce Barker
    Mar 29, 2006
  4. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    736
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  5. vunet
    Replies:
    2
    Views:
    748
    vunet
    Dec 10, 2007
  6. steven
    Replies:
    2
    Views:
    720
  7. 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:
    331
    Raghavendra T V
    Aug 31, 2004
  8. Cathy

    Dynamically Added User Control not accessible!

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