views:

71

answers:

1

Using ASP.NET MVC 2.0, I have an actionlink that is used for comments on a particular post:

Html.ActionLink("Comments", "Details", new { id = String.Format("{0}#comments",item.Title) })

What happens however is that the #comments gets encoded to %23comments, which doesn't work. Any ideas on getting around that? I've tried Url.Action (same issue) and would prefer not to hard code the link in an href.

Any pointers appreciated.

Thanks, -Simon

A: 

Dan - you were right, "fragment" is the right parameter here. Simply set fragment to the name of the HTML div, and it will get correctly appended.

Thanks, -Simon

Simon Guest