Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 728733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:42:55+00:00 2026-05-14T06:42:55+00:00

This seems like it should be pretty straight forward, but I’m apparently confused. I

  • 0

This seems like it should be pretty straight forward, but I’m apparently confused.

I have a List view that displays a paged list. At the bottom I have a set of actionlinks:

<%= Html.ActionLink("First Page", "List", new { page = 1} ) %>
&nbsp; 
<%= Html.ActionLink("Prev Page", "List", new { page = Model.PageNumber - 1 }) %>
&nbsp;
<%= Html.ActionLink("Next Page", "List", new { page = Model.PageNumber + 1 }) %>
&nbsp;
<%= Html.ActionLink("Last Page", "List", new { page = Model.LastPage } )%>

I’m using the basic default routes setup, except with “List” substituted for “Index”:

            routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "List", id = UrlParameter.Optional } // Parameter defaults
        );

The problem is that the ActionLink helpers are generating links of the form:

http://localhost:2083/Retrofit?page=2

rather than

http://localhost:2083/Retrofit/?page=2

(with the trailing slash after the controller name & before the query string). When the first URL is routed, it completely loses the query string – if I look at Request.QueryString by the time it gets to the controller, it’s null. If I enter the second URL (with the trailing slash), it comes in properly (i.e., QueryString of “page=2”).

So how can I either get the ActionLink helper to generate the right URL, or get the Routing to properly parse what ActionLink is generating?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:42:56+00:00Added an answer on May 14, 2026 at 6:42 am

    You need to choose one of two actions:

    1. Modify your route to take a page parameter instead of the default id, and modify the signature of your action method accordingly.

    2. Modify the calls to Html.AcitonLink() so they name the parameter id – that is, change new { page = ... } to new { id = ... }.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This feels like it should be pretty simple, but not much seems to be
This one seems like it should be pretty straightforward, but I couldn't quite figure
This seems like it should be pretty obvious, but I've tried substitute , bquote
This seems like it should be easy, but I can't quite find an explanation
This seems like it should be obvious but I can't figure it out. Suppose
This seems like it should be something very easy to do, but every time
This seems like it should be an easy thing to do, but for the
This seems like it should be really simple, but I'm unable to figure this
I'm new to this site, but it seems like someone out there should be
This seems like a pretty basic thing to do but although I've been using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.