Posts
1150
Comments
891
Trackbacks
1
T4MVC RedirectToAction problem

I tried to find similar issues but Google-fu failed me.

With TVMVC, you should be able to get rid of some magic strings.  So, for instance, if you have this:

return RedirectToAction("Index", “Foo", new FooViewModel {SomeProperty = false });

you should be able to replace it with:

return RedirectToAction(MVC.Foo.Index(new FooViewModel {SomeProperty = false}));

However, the FooViewModel is always null when it gets to the controller.  I always assume user error, since johnny developer is an idiot, but nothing seems to be working.

posted on Friday, June 08, 2012 2:17 PM Print
Comments
Gravatar
# re: T4MVC RedirectToAction problem
Joshka
6/9/2012 11:53 AM
Why this doesn't work is answered (not for t4mvc specifically, but for ASP.net MVC redirects at stackoverflow.com/...
and
stackoverflow.com/...
googlefu: www.google.com.au/search
Gravatar
# re: T4MVC RedirectToAction problem
jdn
6/9/2012 2:40 PM
@Joshka:

The links make sense, except when I use the magic string version, the model is not null, it is passed to the controller.

It seems like it shouldn't work either.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 2 and 8 and type the answer here: