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 6831293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:43:14+00:00 2026-05-26T22:43:14+00:00

The title sort of explains what I’m trying to do. The reason for this

  • 0

The title sort of explains what I’m trying to do.
The reason for this is that I am trying to implement infinite scrolling on my ASP.NET C# Website. I’ve previous accomplished the “effect” of lazy scrolling with the ListView Control but that was a dirty and ‘slow’ trick that used a DataPager and a couple of HiddenFields.

I would like to send a completely pre-formatted HTML element from a WebMethod to jQuery so that I can append it on the container <div>.

Actually what I need rendered in the WebMethod is a bunch of objects inside a container <div> that are similiar to the Facebook Wall. What I previous had was a ListView (B) nested in another ListView (A). A Single Each <ItemTemplate> from a single ListView had multiple ListViewItems of the other ListView. (A) Representing a wall post and (B) Comments bound to the Primary Key of (A).

Anyway, am I looking at this issue from the right corner or should I figure out some other way of doing this? Please share you thoughts.

Thank you.

  • 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-26T22:43:15+00:00Added an answer on May 26, 2026 at 10:43 pm

    You can just return a string from your webmethod with the html in it – and then pump it directly into an html element on your page on the ‘success’ function. NB I think this is the ‘html()’ element – or you can use .append(text);

    Using JQuery

    $(document).ready(function() {
      // Add the page method call as an onclick handler for the div.
      $("#Result").click(function() {
        $.ajax({
          type: "POST",
          url: "Default.aspx/GetHTMLFormatted",
          data: "{}",
          success: function(msg) {
            // Replace the div's content with the page method's return.
            $("#Result").html(msg.d); // or .append(msg.d);
          }
        });
      });
    });
    

    A better way to do it though is to return a JSON structure and use a template library to emit your html structure. See http://stephenwalther.com/blog/archive/2010/11/30/an-introduction-to-jquery-templates.aspx

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

Sidebar

Related Questions

I'm trying to implement a paging and sorting list in ASP.NET MVC without using
I got this code to sort an unordered list with regards to their title
As the title (sort of) explains, when I'm prototyping in JS, and I need
It seems that I've finally got to implement some sort of threading into my
Like the title says I need to write a function that will sort a
I have a table sort of like this: TABLE BOOKS ID TITLE SUBTITLE ------------------------------------
I am attempting sort this array by each stdClass Object's [title] in an Ubercart
hey guys, like the title says, how can i accomplish this sort of a
The title sort of explains itself. I am making some 'genrative' artwork in flash.
The title sort of sums it up. I was thinking of using Jabaco seeing

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.