Referring to Data Source Controls across Content Controls

Discussion in 'ASP .Net Web Controls' started by Bill Nicholson, Sep 10, 2007.

  1. A page has 2 Content Controls. One Object Data Source is in one of
    those Content Controls. There are Data Controls in both Content
    Controls that can use the Object Data Source. At design time, VS 2005
    will let you assign the Object Data Source to both of the Data
    Controls. However, at runtime, the app Yellow Screens because the
    Object Data Source cannot be resolved unless it's in the same Content
    Control as the Data Control.

    "The DataSourceID of 'GridViewSample' must be the ID of a control of
    type IDataSource. A control with ID 'ObjectDataSourceSample' could
    not be found."


    Also, you can't have a Object Data Source control with the same name
    in two different Content Controls. VS 2005 prevents that.

    Therefore you end up with the exact same identical Object Data Source
    in two places in the aspx code, each with a different name. A
    maintenance nightmare.

    Am I missing something? Is there a better way to do this?

    Thanks,

    Bill
    Cincinnati, OH USA
     
    Bill Nicholson, Sep 10, 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. Microsoft
    Replies:
    3
    Views:
    701
    Hugo Wetterberg
    Oct 4, 2004
  2. hazz
    Replies:
    6
    Views:
    49,637
    SkyUCHC
    Jun 9, 2010
  3. Author Tarun Tyagi
    Replies:
    0
    Views:
    717
    Author Tarun Tyagi
    Dec 29, 2004
  4. Vince
    Replies:
    3
    Views:
    332
    Michael Nemtsev [MVP]
    Mar 27, 2008
  5. slamar
    Replies:
    0
    Views:
    883
    slamar
    Aug 17, 2011
Loading...

Share This Page