VBBRett
asked on
Attempting to create an infinite scroll app using jquery and asp.net
I am attempting to create an infinite scroll app using asp.net and jquery. I would like it to be able to pull 10 records at a time. I did in fact find a somewhat half done solution but it keeps repeating the same information from an xml source. Does anybody have an idea on how I can do this as a commenting system similar to facebook? This is the code that I found in the default.aspx.cs file. How could I make it so that I am only pulling 10 records per postback?
[WebMethod]
public static string Foo()
{
StringBuilder getPostsText = new StringBuilder();
using (DataSet ds = new DataSet())
{
ds.ReadXml(HttpContext.Cur rent.Serve r.MapPath( "App_Data/ books.xml" ));
DataView dv = ds.Tables[0].DefaultView;
foreach (DataRowView myDataRow in dv)
{
getPostsText.AppendFormat( "<p><b>aut hor:</b> {0}</br>", myDataRow["author"]);
getPostsText.AppendFormat( "genre: {0}</br>", myDataRow["genre"]);
getPostsText.AppendFormat( "price: {0}</br>", myDataRow["price"]);
getPostsText.AppendFormat( "publish date: {0}</br>", myDataRow["publish_date"]) ;
getPostsText.AppendFormat( "descripti on: {0}</br></p>", myDataRow["description"]);
}
getPostsText.AppendFormat( "<div style='height:15px;'></div >");
}
return getPostsText.ToString();
}
[WebMethod]
public static string Foo()
{
StringBuilder getPostsText = new StringBuilder();
using (DataSet ds = new DataSet())
{
ds.ReadXml(HttpContext.Cur
DataView dv = ds.Tables[0].DefaultView;
foreach (DataRowView myDataRow in dv)
{
getPostsText.AppendFormat(
getPostsText.AppendFormat(
getPostsText.AppendFormat(
getPostsText.AppendFormat(
getPostsText.AppendFormat(
}
getPostsText.AppendFormat(
}
return getPostsText.ToString();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you roopeshreddy...I am currently reviewing the code that you sent me the link to.
ASKER
Is it best to use a web service to do an example like this?
ASKER