Loosing Route data in RedirectToAction

Posted by user1512359 on Stack Overflow See other posts from Stack Overflow or by user1512359
Published on 2012-07-09T15:12:39Z Indexed on 2012/07/09 15:15 UTC
Read the original article Hit count: 236

Filed under:
|
|
|

hi i have a weird problem and here we go:

i am redirecting using this command :

return RedirectToAction("ViewMessage", "Account", new {id = model.MessageId});

but in ViewMessage action when i try to get id, its null ?!?!?!?!??

string strMessageId = RouteData.Values["id"] as string;

i have done this code in lots of places and it works fine but i dont know what is going on here.... :(

i know i can use TempData but i dont want to :)

© Stack Overflow or respective owner

Related posts about mvc

Related posts about route