2

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>?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
Hovden
  • 23
  • 2

1 Answers1

2

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.

Community
  • 1
  • 1
Omar
  • 39,496
  • 45
  • 145
  • 213