473,651 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeater and XmlDataSource

My repeater is not repeating any items.

I am trying to use an XmlDataSource to load a custom .sitemap file having
content similar to as follows:

<siteMap>
<siteMapNode title="Home" description="Ho me" url="~/default.aspx">
<siteMapNode title="Buy" description="Bu y stuff"
url="~/Buy.aspx" />
<siteMapNode title="Sell" description="Se ll stuff"
url="~/sell.aspx" />
</siteMapNode>
</siteMap>

I've put this file, called "Nav.sitema p", into the path
"~/App_Files/navXML/Nav.config".

In my TopNav.ascx file, I have a repeater as such:
<div>
<ul><asp:Repeat er ID="Repeater1" runat="server">
<ItemTemplate>< li><a href='<%# XPath("@url") %>'><%# XPath("@title")
%></a></li></ItemTemplate>
</asp:Repeater>
</ul>
</div>

In the code-behind, I have something similar to the following:

protected void Page_Load(objec t sender, EventArgs e)
{
XmlDataSource xmlSource = new XmlDataSource() ;
xmlSource.DataF ile = MapPath("~/App_Files/navXML/Nav.sitemap");
xmlSource.XPath = "/siteMap/siteMapNode/siteMapNode";
xmlSource.DataB ind();
Repeater1.DataS ource = xmlSource;
Repeater1.DataB ind();
}

When I run this as posted on the machine I'm posting this newsgroup post (at
home), it works fine, but for some reason on the actual development server
at the office the output is blank. If I add a <HeaderTempla te />, the
repeater shows itself to be functional, but simply no items are displayed.
There is no error messages, the <ItemTemplate /simply never renders any
items. I've validated that the XPath string is identical to what's described
above. What could be some of the causes of this behavior? Any ideas??

Thanks,
Jon

Sep 14 '06 #1
0 1353

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

Similar topics

2
3157
by: mike | last post by:
can somebody please show me some code that will let me populate a checkboxlist from the xmldatasource, and have the text property set to the names in the xml file thanks you can also email me at i_am_the_freshmaka@hotmail.com
2
5592
by: Eric | last post by:
Hello, I have a repeater control bound to an XmlDataSource. Works great. Now, I want to handle the ItemDataBound event--the e.Item.DataItem object in particular. Its type is System.Web.UI.WebControls.XmlDataSourceNodeDescriptor, which contains the XmlNode needed to reference the data. The problem is that _node is a private member of the
3
9163
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't really had any success. I'm pretty sure I should be casting my XPathSelect() call to something so I can get at its attributes. This seems like it should be easy, and maybe I'm missing something obvious. Does anyone have any ideas? Here is the...
2
2675
by: Zulander | last post by:
hi, i am trying to put a session variable in the DataFile of the XmlDataSource, but for some reason i am getting: Server tags cannot contain <% ... %constructs. <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="<% Session("UserPath") %"></asp:XmlDataSource> I have even tried this: <asp:XmlDataSource ID="XmlDataSource1" runat="server"
2
7450
by: sck10 | last post by:
Hello, How do you set the website proxy using the XmlDataSource control? Thanks, sck10
0
1126
by: Will Chamberlain | last post by:
Before I start let me clarify that an XmlDataSource will not work for what I am doing. I am attempting to recreate a .NET version of binding Xml Data Islands to HTML Tables in IE 5.x+. You could easily use an Xml File as DSO and bind to an HTML table, easy. The reason an XmlDataSource doesn't work is because the Xml file isn't downloaded to the client. For my program to work, I need that since I am doing drag and drop and appending...
0
1757
by: pompair | last post by:
Hello, I'm making a quiz game for fun. I have an xml file like this: <?xml version="1.0" encoding="utf-8" ?> <results> <index>99</index> <answers>11</answers> <questions> <question id="1">
8
2066
by: Wessel Troost | last post by:
We are using an XML data source in the Page_Load event of an ASP.NET page, like: protected void Page_Load(object sender, EventArgs e) { // Retrieve XML from web service for product idea in URL string sXML = GetXmlFromWebService(Request); XmlDataSource ds = new XmlDataSource(); ds.Data = sXML;
1
1799
by: Sean | last post by:
I am experiencing a strange problem using the XMLDataSource and DataList controls which I cannot seem to resolve. I am using the controls to read and display a variety of RSS feeds. On my local machine everything runs fine and the latest data is downloaded and displayed correctly. On the remote server this was also running fine but since a few days ago the controls will only show old data even though I know the feeds have been updated. The...
0
8349
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8795
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8460
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7296
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4143
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.