473,383 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How do you nest master-detail data controls?

I am trying to get something to work as so:

Section Title
Item 1
Item 2
Item 3
More...

Section Title
Item 1
Item 2
Item 3
More...

Section Title
Item 1
Item 2
Item 3
More...

When I created the AccessDataSource and set up the Select query, it did return rows. But when I view the web page, all I am getting is this:

Section Title
More...

Section Title
More...

Section Title
More...

Here is my code. Note that in my original source code that I tested, the SelectCommand statements are all on one line. Also the NavigationURL properties do NOT have a _ at the end but are all on one line. I did this here in this example so that it is hopefully easier to read.

<asp:AccessDataSource
ID="AccessDataSource1"
runat="server"
DataFile="~/App_Data/myaccessdb.mdb"
SelectCommand="SELECT TOP 3 sections.sectionname, sections.sectionid FROM items INNER JOIN sections ON items.sectionid = sections.sectionid
WHERE items.advert=false AND items.publish=true"
/>
<asp:DataList
ID="AccessDataSource2"
runat="server"
DataSourceID="AccessDataSource1"
DataKeyField="sectionid">
<ItemTemplate>
<asp:Label
ID="lblSNames"
runat="server"
Text='<%# Eval("sectionname") %>'
/>

<br />

<asp:AccessDataSource
ID="AccessDataSource3"
runat="server"
DataFile="~/App_Data/myaccessdb.mdb"
SelectCommand="SELECT TOP 3 [itemid], [title] FROM [items]
WHERE ([sectionid] = ?) ORDER BY [viewcount] DESC, [title]">
<SelectParameters>
<asp:ControlParameter
ControlID="AccessDataSource2"
Name="sectionid"
PropertyName="SelectedValue"
Type="Int32"
/>
</SelectParameters>
</asp:AccessDataSource>

<asp:Repeater
ID="repLinks"
runat="server"
DataSourceID="AccessDataSource3">
<ItemTemplate>
<asp:HyperLink
ID="lnkItemLink"
runat="server"
NavigateUrl='<%#"~/itempage.aspx?id=" & _
Eval("itemid").ToString %>' Text='<%#Eval("title").ToString%>'
/>
</ItemTemplate>
</asp:Repeater>

<asp:HyperLink
ID="lnkMoreLink"
runat="server"
NavigateUrl='<%#"~/browsesections.aspx?section=" & _
Eval("sectionid").tostring %>'
Text="More..."
/>

<br /><br />

</ItemTemplate>

</asp:DataList>

It looks logically like it should work. But while I do get the section names, I don't seem to get the individual links listed.

Can anyone give me a hint as to where I'm going wrong here?

May 21 '07 #1
0 946

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

Similar topics

1
by: Jurrie | last post by:
Hi all, I use apaches FOP to translate an XML-document into a PDF-document. I use repeatable-page-master-alternitives, but FOP gives some strange errors: Unsupported element encountered:...
3
by: terry | last post by:
Hi, Is it legal or formal to nest tag names? My code is in the following. The <name> is nested. I used java to read the xml file but it seems to not know the nested structure. I need to write...
5
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...
4
by: Steve Franks | last post by:
I have this cool nested master page scenario working great. However what is the correct way to be able to access a strongly typed property at the top level master from a content page that has a...
2
by: Jon Spivey | last post by:
Hi, Using VS 2005/VB.net. I need to add a meta description tag and change a stylesheet link from a page based on a master page. Found this article...
17
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...
10
by: Al | last post by:
Hi all, (Apologies if this is in a FAQ somewhere, I couldn't find anything). Almost every time I do any significant amount of coding in C or C++, I end up wishing C-style comments would nest....
6
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %>...
2
kmartinenko
by: kmartinenko | last post by:
Hi, I am very new to Python and I would like to know if it is possible to nest 'for' statements? The question precipitates from a certain problem I am having with running a simple calculation...
4
by: harijay | last post by:
Hi I am new to writing module and object oriented python code. I am trying to understand namespaces and classes in python. I have the following test case given in three files runner , master and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.