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

  • SEARCH
  • Home
  • 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 617725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:28:02+00:00 2026-05-13T18:28:02+00:00

Here is my desired flow: A static web page (html) uses XHR calls to

  • 0

Here is my desired flow:

  1. A static web page (html) uses XHR calls to an ASP.NET page
  2. The .NET page retrieves information from a remote server using web services
  3. The .NET page returns an HTML “snippet” that is inserted into the static HTML page

I’m getting hung up on how to deal with the HTML snippet generation on the .NET (2.0) page. I’ve thought about something like this in a generic .ashx page:

public void ProcessRequest (HttpContext context)
{
  context.Response.Write("<ul>");
  //assume "people" is a list of data coming from the external web service
  foreach (string person in people)
  {
    context.Response.Write("<li>" + person + "</li>");
  }
  context.Response.Write("</ul>");
}

It just seems a big “ugly”. Has anyone done this another – and possibly more efficient/elegant – way? Any help would be appreciated.

  • 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-13T18:28:02+00:00Added an answer on May 13, 2026 at 6:28 pm

    Returning html for this task is a bit weird, IMO. In most times I prefer the following way. Open your web service to public or add a wrapper to it and just use it directly from js of your static page. The service should return json (preferable) or xml data. On the client side format (print in html as you want) received data using js in callback to the XHR and inject anywhere you want.
    But also I want to cast YAGNI on this task – if it’ll be used only several times and in a few pages, use the most fastest way to implement it. But if you are building some RIA application I recommend you to check ExtJS javascript library.

    Edit 26/02:
    If you can’t use ASP.NET MVC but wanna to use some good framework instead of “Response.Write” stuff please check OpenRasta. It’s one of my favorite web frameworks. It works fine on .Net 2.0 and it’s very flexible and powerful. And also it has a great community.

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

Sidebar

Related Questions

Here's my desired result: Given a ASP.net MVC page that has a block at
When I publish any type of asp.net application, my code is precompiled into various
So here's the input: $in['a--b--c--d'] = 'value'; And the desired output: $out['a']['b']['c']['d'] = 'value';
Totally out of ideas here, could be needing a simple solution. Basically my desired
Here's the gist of my desired scenario : I've got the standard Django pagination
Here's a live demo for your convenience: http://jsfiddle.net/Lr6NQ/2/ On ul#navigation ul , if there
I've taken a code from here (SO) that crops images. I tried it on
So here is the basic HTML I'm using: <body> <li> <img src=Chrome.jpg/> <a title=Chrome
I am a starter in web development. My requirement in a bit unique here.
I'm seeking to display my images with a short title in a flow from

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.