DataSourceID and MasterPages...

I have a strange issue that makes sense, but was very unexpected.

I have a master page with 2 content areas.  I've got an ObjectDataSource1 object in the 1st of those content areas.  I've also got databound controls in both areas that point at that single datasource.  The problem is that when i run the app, any controls in the 2nd Content area gives me the following error:

The DataSourceID of 'FormView2' must be the ID of a control of type IDataSource.  A control with ID 'ObjectDataSource1' could not be found.

FormView2 is the control in the 2nd content area.  If I move the DataSource over to the 2nd content area, the error changes to:

The DataSourceID of 'FormView1' must be the ID of a control of type IDataSource.  A control with ID 'ObjectDataSource1' could not be found.

It's like it can't see the datasource if it's not in the same "Content Area".  I understand WHY this might be, but how am I expected to make this work?  Do I really have to load all the data twice if I want to display it in two content areas?

Thoughts?
LVL 6
kalliopiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

craskinCommented:
i don't know the exact answer to your question, but it sounds to me like a dataset would work better for you.
0
kalliopiAuthor Commented:
I can't find a dataset control in the toolbox for 2005?
0
craskinCommented:
it's not a control. what i meant was you might be better off filling a dataset using a dataadapter. that way, you can programatically databind any controls in the code-behind.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

kalliopiAuthor Commented:
I know that I can do this in code - I'm trying to take advantage of the UI - which is obviously a VERY powerful feature.  What's strange is that it seems to "break" as soon as the controls are in different Content Areas...

Any suggestions about how one is meant to "get around" this limitation?
0
mppetersCommented:
You have to qualify the controls by the content place holder id followed by dollar sign $ and then the control.

So, if you have:

<asp:Content ID="ListCNT" ContentPlaceHolderID="ListPH" Runat="Server">
   <asp:SomeDataSource ...>
     <SelectParameters>
        <asp:ControlParameter ControlID="FilterPH$OrgIdTXT" Name="anOrgId" PropertyName="Text" Type="String" />
         ....
</asp:Content>

<asp:Content ID="FilterCNT" ContentPlaceHolderID="FilterPH" Runat="Server">
      <asp:TextBox ID="OrgIdTXT" TabIndex="1" runat="server" Width="120px"></asp:TextBox>
</asp:Content>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kalliopiAuthor Commented:
I haven't tried it yet - but this looks like EXACTLY what I'm looking for.  I will assume that it will work, and I'll be all set.

Thanks-a-mil!

EJ
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.