图像相当于ActionLink的在ASP.NET MVC [英] Image equivalent of ActionLink in ASP.NET MVC
问题描述
在ASP.NET MVC是那里的Html.ActionLink佣工的img标签的等效?
In ASP.NET MVC is there an equivalent of the Html.ActionLink helper for Img tags?
我有一个输出动态生成的JPEG的控制器操作,我想使用相同的LAMBDA前pressions链接到它,因为我做的ActionLink的使用的HREF。
I have a controller action that outputs a dynamically generated JPEG and I wanted to use the same Lambda expressions to link to it as I do HREFs using ActionLink.
另外,只是给的URL路由(使用Lambda表达式再次指定)一个帮手也将是可以接受的。
Alternatively, a helper that just gives the URL to a route (again specified using Lambdas) would also be acceptable.
修改:我原本规定,我用preVIEW 5,但我看到一个测试已被释放。因此,所有功能于所有版本号是不需要的一块信息,我可能很快会升级: - )
EDIT: I had originally specified that I was using Preview 5, however I see that a Beta has been released. So all-in-all the version number was an unneeded piece of info as I may be upgrading soon :-)
推荐答案
Url.Action()将让你的Html.ActionLink大部分重载裸URL,但我认为URL从 - 拉姆达功能仅适用通过Html.ActionLink至今。希望他们会在某个时候增加一个类似超载Url.Action。
Url.Action() will get you the bare URL for most overloads of Html.ActionLink, but I think that the URL-from-lambda functionality is only available through Html.ActionLink so far. Hopefully they'll add a similar overload to Url.Action at some point.
这篇关于图像相当于ActionLink的在ASP.NET MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!