开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜