This is a migrated thread and some comments may be shown as answers.

EnableSEOPaging does not work.

1 Answer 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sudhanshu Tripathi
Top achievements
Rank 1
Sudhanshu Tripathi asked on 03 Jul 2010, 12:26 PM
Hi,
    in my application, i have used url rewriting(Seo friendly url) ,
in one my aspx page i am using radgrid with EnableSeoPaging true. when i set EnableSEOPaging false then paging is working fine.
when i set EnableSEOpaging true then radgrid paging does not work while in url querystring appned with page no.
like this
http://localhost:53500/alabama/alabaster?ctl00_MainContent_BusinessList1_RadGridListingChangePage=2

but page index of radgrid does not change only 1st page of data show in radgrid.
I also want url shoul look like,
http://localhost:53500/alabama/alabaster/2
how to handle these things
i did not analyze why paging does not work when i set EnableSEOPaging true.

 

<telerik:RadGrid ID="RadGridListing" runat="server" AutoGenerateColumns="false" ShowHeader="false"

 

 

BorderWidth="0" AlternatingItemStyle-BackColor="White" ItemStyle-BackColor="White"

 

 

OnNeedDataSource="RadGridListing_NeedDataSource" GridLines="None" ItemStyle-BorderStyle="None"

 

 

AlternatingItemStyle-BorderStyle="None" Skin="Vista" AllowPaging="true" PageSize="5"

 

 

PagerStyle-Mode="NextPrevAndNumeric" PagerStyle-BackColor="#F3F4F3"

 

OnItemCreated

 

="RadGridListing_ItemCreated">

 

 

 

 

 

 

 

<PagerStyle EnableSEOPaging="true"/>

 

 

<MasterTableView DataKeyNames="UserId" AllowPaging="true">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

<div style="vertical-align: top">

 

 

<asp:HyperLink ID="HypPracticeName" runat="server" Text='<%#bind("PracticeName")%>'

 

 

ForeColor="#0A0A0A" Font-Bold="true" Font-Size="12px">

 

 

</asp:HyperLink>

 

 

</div>

 

 

<div>

 

 

<asp:Label ID="LblAddress" runat="server" Text='<%#Bind("StreetName") %>' Font-Size="12px"></asp:Label></div>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 


in aspx.cs page

 

protected void RadGridListing_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

 

 

 

TList<BusinessUsers> objUsers = DataRepository.BusinessUsersProvider.GetByCityId(this.CityId);

 

objUsers.Sort(

"UserId asc");

 

 

if (objUsers.Count > 0)

 

RadGridListing.DataSource = objUsers;

}

 

 

 

 

 

protected void RadGridListing_ItemCreated(object sender, GridItemEventArgs e)

 

{

 

if (e.Item is GridDataItem)

 

{

 

long UserId = long.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["UserId"].ToString());

 

 

TList<BusinessPerCity> objPerCity = DataRepository.BusinessPerCityProvider.GetByCityId(this.CityId);

 

objPerCity.Filter =

"IsFeatured = True";

 

objPerCity.ApplyFilter();

objPerCity.Sort(

"UserId asc");
//here is my business logic

 

}

}






1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 06 Jul 2010, 02:29 PM
Hello Sudhanshu,

In your page, check whether the Request.QueryString collection has a value under the key ctl00_MainContent_BusinessList1_RadGridListingChangePage. This indicates that the query string key that RadGrid uses for SEO paging is set correctly. If the key is not there, then I believe there is something wrong with the URL rewriter that causes the query string in the URL to not be properly parsed.

As for friendlier URLs like http://localhost:53500/alabama/alabaster/2, RadGrid will support URL Routing for RadGrid's SEO Paging in ASP.NET 4.0. Only the native URL Routing module will be supported, though. No third party URL rewriters or mappers are guaranteed to work with RadGrid's SEO pager.

All the best,
Veli
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Sudhanshu Tripathi
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or