views:

15

answers:

2

How can I produce following code in AspNet MVC with ActionLink (not format throw css)

<a href="#"><anotherHtmlElement>Title</anotherHtmlElement></a>
example
<a href="#"><strong>Title</strong></a>

Sorry for my bad english

A: 

You can't unless You introduce new htmlHelper extension method.

Arnis L.
A: 

Why do it that way? How about

 <anotherHtmlElement><a href="#">Title</a></anotherHtmlElement>

Also, rather than using <strong>, you should be handling your formatting in CSS.

David Lively
Why not? E.g. - if `img` tag is supposed to work as a link, it must be surrounded with `a` tag.
Arnis L.
MvcHtmlString automatically encodes the string. It's safer that way ;-)
gnome