Note that there are some explanatory texts on larger screens.

plurals
  1. POQueryStringField of DataPager and ASP.NET Page Route?
    primarykey
    data
    text
    <p>I am using QueryStringField to of DataPager to show page number in url. Work fines. But i don't want the name of field to be shown in url. what i tired is</p> <p>Global File Code:</p> <pre><code>protected void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } void RegisterRoutes(RouteCollection routes) { routes.MapPageRoute("xyz", "Test/TestRoutes/{PageId}", "~/Demo1.aspx", true, new RouteValueDictionary { { "PageId", "1" } }); } </code></pre> <p>and in html i wrote for DataPager.</p> <pre><code> &lt;asp:DataPager ID="ProductListPagerComboTop" runat="server" PagedControlID="lv1" PageSize="5" QueryStringField="PageId"&gt; &lt;Fields&gt; &lt;asp:NextPreviousPagerField RenderNonBreakingSpacesBetweenControls="false" ButtonCssClass="pagerButton" FirstPageText="&amp;lt;&amp;lt;" ShowFirstPageButton="True" ShowNextPageButton="False" /&gt; &lt;asp:NumericPagerField CurrentPageLabelCssClass="pagerButtonCurrentPage" RenderNonBreakingSpacesBetweenControls="false" NextPreviousButtonCssClass="pagerButton" NumericButtonCssClass="pagerButton" /&gt; &lt;asp:NextPreviousPagerField RenderNonBreakingSpacesBetweenControls="false" ButtonCssClass="pagerButton" LastPageText="&amp;gt;&amp;gt;" ShowLastPageButton="True" ShowPreviousPageButton="False" /&gt; &lt;/Fields&gt; &lt;/asp:DataPager&gt; </code></pre> <p>So the url generated is :</p> <pre><code>http://localhost:2055/Test/TestRoutes?PageId=2 </code></pre> <p>where as i want.</p> <pre><code>http://localhost:2055/Test/TestRoutes/2 </code></pre> <p>How to do this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload