This project is read-only.

Url.Action not working

Apr 1, 2013 at 6:40 PM
In the Suspension List view I have the following code, which is returning an empty href for each a tag. I'm probably missing something simple, so any help will be appreciated.
@Html.PagedListPager(Model, page => Url.Action("List", "Suspension"
 , new { ViewBag.id, page }))
routes.MapRoute(null, "Account/Suspension/List/{id}/{page}"
, new { controller = @"Suspension", action = @"List"
  , page = UrlParameter.Optional }
, new { id = @"0|-?[1-9]\d*", page = @"(0|-?[1-9]\d*)?" }
, new[] { "MdaMessaging.Controllers.Admin.Account" });
Apr 1, 2013 at 7:07 PM
I figured out my problem. If I'm going to use ViewBag then I should remember to set it in the controller.
Marked as answer by maxtoroq on 10/15/2013 at 9:20 AM
Apr 1, 2013 at 7:15 PM
It's always a good idea to test with constants to rule out any URL generation issues.