Generate urls using T4MVC in a controller action

柔情痞子 提交于 2019-12-23 07:27:28

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/9350992/generate-urls-using-t4mvc-in-a-controller-action

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!