开发者

asp.net mvc route to a div on view

开发者 https://www.devze.com 2023-01-06 03:58 出处:网络
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>

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

精彩评论

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

关注公众号