Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4059440
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:12:33+00:00 2026-05-20T15:12:33+00:00

I have a simple XML document with data needed to fill in an HTML

  • 0

I have a simple XML document with data needed to fill in an HTML template. Using C#, how do I pull the data and fill in an HTML template page?

Assuming:

string baseurl = "http://mysite.com/page.aspx?id=";

XML Data – Data.xml:

<container>
    <item>
        <name>Clark</name>
        <id>10</id>
        <range>week</type>
    </item>
    <item>
        <name>Cowlitz</name>
        <id>11</id>
        <range>daily</range>
    </item>
</container>

HTML Template – Default.aspx:

<asp:Repeater ID="Repeater1" runat="server">
    <ItemTemplate>
        <h3><%# Eval("Name") %></h3>
        <img src="<% baseurl %><%# Eval("id") %>
        &range=<%# Eval("range") %>" alt="<%# Eval("name") %>" />
    </ItemTemplate>
</asp:Repeater>

I apologize for the simple question, but I simply cannot find a good recipe for this task. I’m not sure if I should use a repeater, or if I should format all the HTML in the codebehind and then dump it into something like a Literal.

This was a fairly simple task using my prior language, but with C#, I’m finding that there are many ways of handling XML, and I’m really not sure which one I should pursue for such a limited and seemingly simple task.

Thanks for any advice.
Dan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:12:34+00:00Added an answer on May 20, 2026 at 3:12 pm

    You should look at the XmlDataSource class. There are numerous good tutorials around the place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple xml document that looks like the following snippet. I need
Situation: I have a simple XML document that contains image information. I need to
I have a simple question about Java's XML API and I hope there's a
Ok, i have simple scenario: have two pages: login and welcome pages. im using
I have the following sample XML structure: <SavingAccounts> <SavingAccount> <ServiceOnline>yes</ServiceOnline> <ServiceViaPhone>no</ServiceViaPhone> </SavingAccount> <SavingAccount> <ServiceOnline>no</ServiceOnline>
My problem is the following. I have a method which simply takes an XML
Every sample that I have seen uses static XML in the xmldataprovider source, which
I have several identical elements with different attributes that I'm accessing with SimpleXML: <data>
I have simple regex \.*\ for me its says select everything between and ,
In general, is it a best practice to have simple POJO Java classes implement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.