Wednesday, 23 April 2014

Redirect Page with Querystring in MVC



return RedirectToAction("MethodName", new { categoryId = TempData["CategoryId"] });


Here,

Method Name is a function which is created in controller.

CategoryId must be a part of that parameter.

TempData["CategoryId"] because it is going to redirect the page. so Viewbag is not reliable to use.




No comments:

Post a Comment