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 859363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:40:18+00:00 2026-05-15T08:40:18+00:00

Just beginning my journey in ASP.Net MVC and I have a query about something

  • 0

Just beginning my journey in ASP.Net MVC and I have a query about something before I dig myself in too deep.

I have a table, which is paged, and I have 2 controls above the table:

  • Dropdown that defines order of the results and apply button next to it
  • Textbox that defines a filter and apply button next to it

What I need to achieve is that if the user changes the order or adds a filter I fire of an AJAX call to my action like such: /Membership/Users?sort=value&filter=value&page=pagenumber. So my controller action is:

   // GET Membership/Users?sort=&filter=&page=
   public ActionResult Users(string sort, string filter, string page)

So I have 3 questions:

  • Is this the correct approach?
  • What would be the best way to ensure that the query string is maintained, bearing in mind that the action will nearly always be called by Jquery/Ajax functions?
  • If I wanted to link directly to this action passing the arguments would I need to hard-code the querystring?

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-15T08:40:19+00:00Added an answer on May 15, 2026 at 8:40 am

    You could define a new route in the format Membership/Users/{sort}/{filter}/{page}.

    routes.MapRoute(
            "MembershipList",                                              
            "Membership/Users/{sort}/{filter}/{page}",             
            new { controller = "Membership", action = "Users", sort = "", filter = "", page = "" }
        );
    

    However, if the parameters are optional then I would suggest you leave it as is and don’t define a route.

    As you are passing through strings then they will simply be passed as null if for some reason no query strings are passed, your action should handle this and still render a view.

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

Sidebar

Related Questions

I am just beginning to localize an ASP.NET MVC application. Most of the strings
I'm just beginning a project where my system (written in .NET MVC) will have
I am just beginning my journey into web development and I have a very
I'm just beginning Android and have gotten myself stuck. I've made a simple app/view.
I'm just beginning to learn Java and I have been very frustrated about learning
I'm just beginning to dabble in ASP.NET MVC3 to mock up a dummy web
I am just beginning to work with Rails. I have a model, User and
I am just beginning to get into desktop application development, and have chosen C#
I am just beginning to git for the first time and have git and
I am just beginning to play around with .NET (using C#). Which namespace, aside

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.