I've created a custom button helper. I pass text, url, css attributes, and everything works perfectly fine. The only thing that I would like to improve is to incorporate a ActionLink functionality into that bu开发者_运维问答tton. For example I would like to pass the action name and the controller name and that would return the link to that page (just like ActionLink)
Does anyone worked on that same issue and is willing to share, or at least give me hint on how to do it? thank you for help!
Use the Url.Action method for this problem.
You can use the methods in the Url
object to get URLs for actions.
If you don't have a Url
object, you can write new UrlHelper(ViewContext.RequestContext)
.
精彩评论