Hello,
I'm trying to implement an infinite scrolling method. I'm trying to use the method described on this page:http://www.fieg.nl/infinite-ajax-scroll-a-jquery-plugin That method basically takes your pagination links and uses those to get the next batch of records when the user scrolls to the bottom of the page. I seem to be running into some sort of conflict with this and the radrating control. With the radrating control enabled on the page, i get the above error (Invalid JSON primitive) when ever i cause a post back. It can either be a postback caused by a .net control set to autopostback=true, or it just be a simple html submit button. Also, the rad rating controls stop working once you go past the first page of records.
If i remove the rad rating control from the page, then the scrolling and doing a postback work as expected.
The rating control is inside of a .net listview. The only code on page load which that I have that deals with the rating control is this:
And this code seems to work correctly as i scroll down the page - it's getting fired every time you scroll to the bottom of the page and it appears to be passing correct values. However, my rating_changed event never fires once you scroll past the first page.
I have an idea as to why this is happening. Since this infinite scroll works by essentially loading the next page and then appending just the specific html involved with the page, i think there's 2 errors this causes.
1. The control ID's are getting duplicated because as far as the .net page knows, it's loading up a new page. So if the last ID on the first page was radrating1_5, when i load the next page, it has no reason not to re-use that ID since it think it's a new page.
2. Any script associated with these controls isn't being properly loaded since it's not included inside the content tags where the page data lives. And that infinite scroll only loads what's inside the content container div.
So i have a few questions
1. anyone know of an infinite scrolling plugin that'll work on a page with multiple rad rating controls?
2. if not, would there be any problem if i set the control id's in codebehind with each page load so that i can ensure each control has a unique ID?
3. Is there any way to control where all the javascript gets rendered for each control? Because I have a feeling any infinite scroll plugin will have a problem with the jscript code loading outside of where the content loads.
I'm trying to implement an infinite scrolling method. I'm trying to use the method described on this page:http://www.fieg.nl/infinite-ajax-scroll-a-jquery-plugin That method basically takes your pagination links and uses those to get the next batch of records when the user scrolls to the bottom of the page. I seem to be running into some sort of conflict with this and the radrating control. With the radrating control enabled on the page, i get the above error (Invalid JSON primitive) when ever i cause a post back. It can either be a postback caused by a .net control set to autopostback=true, or it just be a simple html submit button. Also, the rad rating controls stop working once you go past the first page of records.
If i remove the rad rating control from the page, then the scrolling and doing a postback work as expected.
The rating control is inside of a .net listview. The only code on page load which that I have that deals with the rating control is this:
protected
void
ListView1_ItemCreated(
object
sender, ListViewItemEventArgs e)
{
if
(e.Item.ItemType == ListViewItemType.DataItem )
{
ListViewDataItem myDataItem = (ListViewDataItem)e.Item;
System.Web.UI.WebControls.DataKey myKey =
this
.ListView1.DataKeys[myDataItem.DisplayIndex];
Decimal rating = (Decimal)ListView1.DataKeys[myDataItem.DisplayIndex][
"Rating"
];
string
id = ListView1.DataKeys[myDataItem.DisplayIndex][
"ID"
].ToString();
RadRating myRad = (RadRating)e.Item.FindControl(
"RadRating1"
);
myRad.Value = rating;
myRad.Attributes[
"GameId"
] = id;
}
}
And this code seems to work correctly as i scroll down the page - it's getting fired every time you scroll to the bottom of the page and it appears to be passing correct values. However, my rating_changed event never fires once you scroll past the first page.
I have an idea as to why this is happening. Since this infinite scroll works by essentially loading the next page and then appending just the specific html involved with the page, i think there's 2 errors this causes.
1. The control ID's are getting duplicated because as far as the .net page knows, it's loading up a new page. So if the last ID on the first page was radrating1_5, when i load the next page, it has no reason not to re-use that ID since it think it's a new page.
2. Any script associated with these controls isn't being properly loaded since it's not included inside the content tags where the page data lives. And that infinite scroll only loads what's inside the content container div.
So i have a few questions
1. anyone know of an infinite scrolling plugin that'll work on a page with multiple rad rating controls?
2. if not, would there be any problem if i set the control id's in codebehind with each page load so that i can ensure each control has a unique ID?
3. Is there any way to control where all the javascript gets rendered for each control? Because I have a feeling any infinite scroll plugin will have a problem with the jscript code loading outside of where the content loads.