问题
I'd like to wrap a span with an action link because I'm adhering to an existing CSS theme. It doesn't look like any of Html.ActionLink
's constructors allow for this. Possible solutions:
- A way to achieve this with existing helper?
- Derive & override ActionLink with new custom html helper?
If #2 is the only way I have two questions.
- When I right click ActionLink and hit go to definition I only see the constructor signature not that actual code body. How do I see the original function body? I don't see anything on MSDN either
- The above will more or less tell me, but, how to generate action url dynamically?c
回答1:
<a href="<%= Url.Action(...) %>"><span></span></a>
来源:https://stackoverflow.com/questions/3470622/wrapping-an-element-with-html-actionlink