0

that action

localhost:39217/SomeAction/

returns the whole list from the DB

If I proceed using the URL

localhost:39217/SomeAction/#someId?p=2

I want to return only the 2nd page from the DB. But I still get the whole list. Why ?

Here's my Action:

public ActionResult SomeAction(int p = 1) //the `p` is always 1, even if I pass that 2nd URL
{
...
}
7
  • 1
    You are obviously going to have to replace ... with your actual code for us to be able to help you. Commented Feb 17, 2012 at 0:27
  • int the ... I just filter the Select query based on the p number Commented Feb 17, 2012 at 0:30
  • 1
    I have no idea what a "Select query" is. However, you need to show us how you are consuming parameter p in order for us to help you. Why don't you show us that code? Commented Feb 17, 2012 at 0:32
  • ...which is probably where the issue is. Commented Feb 17, 2012 at 0:32
  • Side comment: This question is not phrased properly. Intercepting the url route parameters before the controller is constructed is far more complex then "Select query based on the p number". Commented Feb 17, 2012 at 0:33

1 Answer 1

2

Your 2nd URL is messed up.

Querystring parameters must go before anchors.

Try:

localhost:39217/SomeAction?p=2#someId

Sign up to request clarification or add additional context in comments.

2 Comments

OK, but I e.g I set the URL hash using window.location.hash = 'someId' + '?p=2'. If I proceed by that URL to the other browser's tab, the URL should be like You've answered to get the server's filtering works
@user1215114 - not sure what your talking about. You need to explain yourself a little better.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.