ActionLink With Anchor

48 views
Skip to first unread message

Travis

unread,
Sep 22, 2010, 9:43:26 AM9/22/10
to mvccontrib-discuss
Is it possible to add a #anchor to the end of the URL generated by the
RedirectToAction extension method?

Here is my SO Question: http://stackoverflow.com/questions/3764318/add-an-anchor-to-redirecttoactions-result

Jeremy Skinner

unread,
Sep 22, 2010, 12:46:40 PM9/22/10
to mvccontri...@googlegroups.com
No, this isn't possible with the current implementation of RedirectToRouteResult<T>.

Internally it just uses the expression parsing features of McvFutures to construct a RouteValueDictionary that is then passed to the framework's built in RedirectToRouteResult which has no facility for generating anchors. Your best bet is to use Url.Action with RedirectResult, but you lose the strong typing.

Jeremy Skinner
Sent from my iPhone

> --
> Contact Jeffrey Palermo or Eric Hexter with specific questions about the MvcContrib project. Or go to http://mvccontrib.org
>
> To unsubscribe from this group, send email to mvccontrib-disc...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/mvccontrib-discuss?hl=en

Reply all
Reply to author
Forward
0 new messages