user1215114
user1215114

Reputation: 13

ASP.NET How to get the URL's parameters before post to the server?

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
{
...
}

Upvotes: 0

Views: 213

Answers (1)

RPM1984
RPM1984

Reputation: 73132

Your 2nd URL is messed up.

Querystring parameters must go before anchors.

Try:

localhost:39217/SomeAction?p=2#someId

Upvotes: 2

Related Questions