Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate urls using T4MVC in a controller action

I am using t4mvc to generate links in my project. I would like to generate urls in a controller action, can this be done using t4mvc?

like image 681
ilivewithian Avatar asked Feb 19 '12 16:02

ilivewithian


1 Answers

Yes!

string url = Url.Action(MVC.Views.Index());

.. for example. You should get the same set of objects you get in your views, just access the MVC object and pass it to Url.Action().

Some more notes about using T4MVC in a controller action here: http://www.davidferguson.me.uk/Blogs/Post/strongly-typed-actions-views-and-controllers-with-t4mvc

like image 99
Steve Hobbs Avatar answered Nov 17 '22 16:11

Steve Hobbs