Programming Forums
User Name Password Register

RSS Feed

Thread Tools Display Modes
Old Oct 17th, 2009, 6:02 PM   #1
Join Date: Nov 2008
Posts: 55
Rep Power: 10 drumnbassbboy is on a distinguished road
Error: The DataSourceID of 'Repeater1' must be the ID of a control of type IDataSource. A control with ID 'AccessDataSource1' could not be found.

I looked up why I was getting this error. The reason people where saying was because I do not have an AccessDataSource1 control in my .aspx file, which I do. They say it looks for the AccessDataSource1 in the .aspx file, and not the code behind the .aspx file. So this has me a bit puzzled since I do have a AcessDataSource1 in my .aspx code / file. Here is the code from the MasterPage.master file. I have tried a little bit of everything. I even changed the DataSourceID property to DataSource to only get the following error:
"The 'DataSource' property cannot be set declaratively." Mind you, still new to .asp / .aspx. Thanks in advance for the help.

MasterPage.master code:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <title>Untitled Page</title>
    <asp:ContentPlaceHolder id="head" runat="server">
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<div id="main"><!-- start header -->
<div id="header">
 <div id="logo">
        <h1><a href="#">metamorph_highway</a></h1>
        <h2><a href="" id="metamorph">Design by Metamorphosis Design</a></h2>
        <div id="menu">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Blogs</a></li>
                        <li><a href="#">Photos</a></li>
                        <li><a href="#">About</a></li>
                        <li><a href="#">Contact</a></li>
<!-- end header -->
<hr />
<!-- start page -->
<div id="page">
        <!-- start content -->
        <form id="form1" runat="server">
        <div id="content">
                <div class="post">
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server" >
            <asp:AccessDataSource ID="AccessDataSource1" runat="server"
                SelectCommand="SELECT DISTINCT Brand FROM shirts_table ORDER BY Brand">
        <!-- end content -->
        <!-- start sidebar two -->
        <div id="sidebar2" class="sidebar">
                                <ul class="back_title">
                                        <li class="top">
                        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="AccessDataSource1">
                              <a href="shop.aspx?Brand=<%# DataBinder.Eval(Container.DataItem, "Brand") %>">
                              <%# DataBinder.Eval(Container.DataItem, "Brand") %></a>

                        <a href="#">Aliquam libero</a></li>
                                        <li><a href="#">Consectetuer elit</a></li>
                                        <li><a href="#">Metus pellentesque</a></li>
                                        <li><a href="#">Suspendisse mauris</a></li>
                                        <li><a href="#">Urnanet molestie semper</a></li>
                                        <li><a href="#">Proin orci porttitor</a></li>
                                <ul class="back_title">
                                        <li class="top"><a href="#">September</a> (23)</li>
                                        <li><a href="#">August</a> (31)</li>
                                        <li><a href="#">July</a> (31)</li>
                                        <li><a href="#">June</a> (30)</li>
                                        <li><a href="#">May</a> (31)</li>
                                <h2>Lorem ipsum dolor </h2>
                                <ul class="back_title">
                                        <li class="top"><a href="#">Aliquam libero</a></li>
                                        <li><a href="#">Consectetuer elit</a></li>
                                        <li><a href="#">Metus pellentesque</a></li>
                                        <li><a href="#">Suspendisse mauris</a></li>
                                        <li><a href="#">Urnanet molestie semper</a></li>
                                        <li><a href="#">Proin orci porttitor</a></li>
        <!-- end sidebar two -->
        <div style="clear: both;">&nbsp;</div>
<!-- end page -->
<hr />
<!-- start footer -->
<div id="footer">
        <p>Copyright &copy; 2008. <a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a> | <a href="" title="This page validates as XHTML 1.0 Transitional"><abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a> | <a href="" title="This page validates as CSS"><abbr title="Cascading Style Sheets">CSS</abbr></a></p>
        <p>Design by <a href="" title="Free Site Templates">Free Site Templates</a>, coded by <a href="" title="Free Flash Templates">Free Flash Templates</a>
<!-- end footer -->

shop.aspx code:
<%@ Page MasterPageFile="~/MasterPage.master" Language="C#" AutoEventWireup="true"  CodeFile="shop.aspx.cs" Inherits="_Default2" %>

<asp:Content id="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
    AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="AccessDataSource1">
        <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"
            ReadOnly="True" SortExpression="ID" />
        <asp:BoundField DataField="Brand" HeaderText="Brand" SortExpression="Brand" />
        <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
        <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
        <asp:TemplateField HeaderText="Image" SortExpression="Image">
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Image") %>'></asp:TextBox>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Image") %>'></asp:Label>
        <asp:HyperLinkField DataNavigateUrlFields="ID"
            DataNavigateUrlFormatString="ShowDetails.aspx?ID={0}" />
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
    SelectCommand="SELECT * FROM [shirts_table] WHERE ([Brand] = ?) ORDER BY [Type]">
        <asp:QueryStringParameter DefaultValue="Apple" Name="Brand"
            QueryStringField="Brand" Type="String" />
drumnbassbboy is offline   Reply With Quote


« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show web user control hidden see07 C# 4 Aug 15th, 2010 10:44 PM
Saving image from picture control darkies22 C++ 1 Jan 31st, 2008 6:53 AM
How to add inherited control to toolbox. InfoGeek C# 3 Feb 8th, 2007 10:12 PM
Pointer return type,.. ??? Mack1982 C++ 28 May 26th, 2006 9:02 PM
C programing control of the Serial Port. Light C++ 5 Feb 24th, 2005 3:14 PM

DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:28 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC