asp.net mvc route to a div on view
I want to create a link to a specific div on a view.
I was thinking something along these lines
<a href="开发者_运维知识库<%= Url.Action("#about", "Home") %> > </a>
or
<a href="<%= Url.Action("~/Views/Home/About.ajax/#about")%> >
I know this isn't right. How can I create a link to a div or specific tag on the destination view, in the style of <a name="someTagName"></a>
?
Just add the #about
right after the closing %>
.
<a href="<%= Url.Action("~/Views/Home/About.ajax/")%>#about">Your link text</a>
Take a look at this question and its answers.
精彩评论