177

I have two questions:

  1. I'm wondering how I can display no link text when using Html.ActionLink() in an MVC view (actually, this is Site.Master).

There is not an overloaded version that does not allow link text, and when I try passing in just a blank string, the compiler tells me it needs a non-empty string.

How can I fix this?

  1. I need to put <span> tags within the anchor tag, but it's not working with Html.ActionLink();. I'd like to see the following output:

    Span text

How can I put tags inside of the anchor tag in ASP.NET MVC?

dav_i
  • 27,509
  • 17
  • 104
  • 136
Matt
  • 23,363
  • 39
  • 111
  • 152
  • 1
    What would be the purpose/use of having a blank action link? – David Dec 29 '09 at 14:47
  • 2
    I'm using an image sprite for a navigation bar, and the `
  • ` you're seeing is a particular navigation button (with size, background pos, etc specified in css stylesheet). But it must link to something, so I don't want to display the text. I want the sprite to do that for me.
  • – Matt Dec 29 '09 at 14:53