Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

DataSourceID and MasterPages...

Posted on 2006-03-21
6
Medium Priority
?
1,119 Views
Last Modified: 2012-05-05
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?
0
Comment
Question by:kalliopi
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:craskin
ID: 16252476
i don't know the exact answer to your question, but it sounds to me like a dataset would work better for you.
0
 
LVL 6

Author Comment

by:kalliopi
ID: 16252648
I can't find a dataset control in the toolbox for 2005?
0
 
LVL 12

Expert Comment

by:craskin
ID: 16252737
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Author Comment

by:kalliopi
ID: 16252899
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
 
LVL 8

Accepted Solution

by:
mppeters earned 2000 total points
ID: 16261685
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
 
LVL 6

Author Comment

by:kalliopi
ID: 16273972
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses
Course of the Month11 days, 8 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question