Announcement

Collapse
No announcement yet.

XmlDataSource

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • XmlDataSource

    Hallo,
    ich benutze Vis.Stud. 2008 und habe mit dem XmlDataSource-Tool folgendes Problem:
    Unter 'Datenquelle konfigurieren' kriege ich keine xml-Datei angezeigt. Egal ob im Verzeichnis App_Data oder sonstwo. Eine entsprechende xml-Datei ist natürlich vorhanden. Trage ich den Pfad direkt ein (z.B. ~/App_Data/buch.xml) wird keine Verknüpfung hergestellt.
    Ich verstehe das nicht - hat jemand einen Tipp?

    Danke,
    zx81hw

  • #2
    Hallo,

    Tutorials dazu gibt es hier: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/xmldatasource.aspx


    mfG Gü
    "Any fool can write code that a computer can understand. Good programmers write code that humans can understand". - Martin Fowler

    Comment


    • #3
      [highlight=aps.net]
      <?xml version="1.0" encoding="utf-8" ?>
      <IranHistoricalPlaces>
      <Place name="Taghe Bostan">
      <City>Kermanshah</City>
      <Antiquity>2000</Antiquity>
      </Place>
      <Place name="Persepolis">
      <City>Shiraz</City>
      <Antiquity>2500</Antiquity>
      </Place>
      </IranHistoricalPlaces>

      <asp:Repeater ID="Repeater" runat="server" DataSourceID="XmlDataSource">
      <ItemTemplate>
      <Strong><%# XPath("@name") %><br /></Strong>
      <%#XPath("City")%><br />
      <%#XPath("Antiquity")%><br />
      </ItemTemplate>
      </asp:Repeater>
      <asp:XmlDataSource ID="XmlDataSource" runat="server" DataFile="~/XMLFile.xml"
      XPath="IranHistoricalPlaces/Place">
      </asp:XmlDataSource>

      <asp:XmlDataSource ID="XmlDataSource" DataFile="http://nayyeri.net/rss.aspx"
      XPath="rss/channel/item" runat="server"></asp:XmlDataSource>
      <aspataList ID="DataList" runat="server" DataSourceID="XmlDataSource">
      <ItemTemplate>
      <font face="tahoma" size="6"><Strong><%#XPath("title")%><br />
      </Strong></font>
      <%#XPath("description")%><br />
      <font color="navy"><i><%#XPath("pubDate")%><br /></i></font>
      </ItemTemplate>
      </aspataList>
      [/highlight]
      Zuletzt editiert von gfoidl; 04.10.2009, 18:27. Reason: Code-Formatierung

      Comment

      Working...
      X