Maintaining URL Parameters for Navigation

My index action for the controller accepts the page parameter as follows:

/Organizations/Index?page=5

Used to limit the number of displayed objects. If they want to "edit" one of these objects after they are completed, I would like to return with the same values ​​as before they started editing (for example, to be on the same "page" of the list).

My edit url is as follows:

/Organizations/Edit/487

How to save the value of the original page?

Thank!

+3
source share
2 answers

To save data between calls, you can use

  • Session Status
  • hidden field
  • attribute it to links as a query string,
  • use cookie or
  • TempData ( ).

, :

ControllerContext.RouteData.Values["action"];

"" - .

+5

:

1) Source GET . : ///487? Source =//Index? = 5

, URL- .

2) , slfan, hdden- ( Session ). , , HttpContext.Current.Request.UrlReferrer . , POST, UrlReferrer, URL- .

+2
source

All Articles