DataPager and RewriteModule [Answered]RSS

5 replies

Last post Aug 03, 2009 02:23 PM by ruslany

  • DataPager and RewriteModule

    Jul 22, 2009 08:12 AM|sadegh-shad|LINK

     I used DataPager for moving to pages

     <asp:DataPager ID="dpSummary" class="pager" runat="server" PagedControlID="lvSummary"
    QueryStringField="page" PageSize="10">
      <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />
      <asp:NumericPagerField />
      <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" />

     and would change  news/default.aspx?page=3 to news/3.aspx by rewriteModule.

    What should I do?

    RewriteModule DataPager

  • Re: DataPager and RewriteModule

    Jul 22, 2009 01:57 PM|ruslany|LINK

    Do you mean you want users to browse to and then rewrite it to ?

  • Re: DataPager and RewriteModule

    Jul 22, 2009 03:14 PM|sadegh-shad|LINK

     yes, This is true

  • Re: DataPager and RewriteModule

    Jul 27, 2009 02:35 PM|ruslany|LINK

    This can be done with a relatively simple rule:

    <rule name="news" >
                        <match url="^news/(\d+)\.aspx$"  />
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        <action type="Rewrite" url="news/default.aspx?page={R:1}" />

  • Re: DataPager and RewriteModule

    Aug 01, 2009 03:02 AM|sadegh-shad|LINK

     thanks ruslan but this isnt my purpose.


    i want to change DataPager links href attribute from news.aspx?page=id to id.aspx


    thanks again

  • Re: DataPager and RewriteModule

    Aug 03, 2009 02:23 PM|ruslany|LINK

    Thats a more difficult task but can be done with URL rewrite 2.0 beta. You will have to create a rewrite rule that changes the href attribute in the response generated by ASP.NET control. Here is an article which explains how to do something like this: