473,506 Members | 9,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Master Pages and Data Sources

I'm trying to use data sources with data bound controls on one of my
pages that's using a master page. The master page has 2
ContentPlaceHolders, and in my page the data sources are in the first
content area, and the data bound controls are in the second. The data
bound controls are having a problem seeing the data sources at run time
(even though everything is picked up by the visual studio at design
time).

I get an error message similar to the following:
----------------------------------------
[HttpException (0x80004005): The DataSourceID of 'drpEmployee' must be
the ID of a control of type IDataSource. A control with ID
'EmployeeDataSource' could not be found.]
System.Web.UI.WebControls.DataBoundControl.GetData Source() +194
System.Web.UI.WebControls.DataBoundControl.Connect ToDataSourceView()
+160
System.Web.UI.WebControls.DataBoundControl.OnLoad( EventArgs e) +17
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+3695
----------------------------------------

After scouring the net for information on this error, I found that it's
most likely because the datasource is being loaded after the control
that's referencing it. When I move the datasource into the same
content area as the bound control, the control finds it.

It seems that the master page is parsing its ContentPlaceHolders in
arbitrary order. I don't know if this is by design or a bug in ASP.NET
beta 2, but if anyone has more info, insight, workarounds, etc. it
would be much appreciated.

Nov 19 '05 #1
0 1135

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1131
by: Diego | last post by:
Hi all I'd like to understand something about master pages: 1)Why if if try to typecast a masterpage inside a "child page" the compiler tells it dont find the class? I was trying to declare a...
5
2398
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
14
2377
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
3
1436
by: Joel Reinford | last post by:
I am attempting to learn how to use Master Pages in ASP.NET 2.0 and am having no success in getting the content page to see the public properties in the master page. I am using code beside and have...
1
2934
by: LilC | last post by:
I'm creating an application that has a standard layout for all pages. The information that is displayed in the layout will be dynamic based on the user that is logged in. Thus when a page is...
17
3134
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
3
1469
by: Eetu | last post by:
Hello, Asp.net 2.0 introduced a new component Master Page. Does it do the same work like controller in MVC model or what is it's purpose? Like to know what component in Asp.Net 2.0 act like...
4
1597
by: Annie | last post by:
Hi guys, I am having a weired situation that don't know how to handle it ... I have master pages, the master page contains a dynaic menu which is set up in the database and has page url, name,...
0
2102
by: james.mcdonagh | last post by:
Hi I am a newbie using nAnt for .net 2.0. As such I have not come across this bug before, and I would be happy of any help that you may be able to provide. In order to help I have included the...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.