Sibusiso Shongwe
Sibusiso Shongwe

Reputation: 175

Nesting elements using razor markup

Am working on an Asp.Net MVC Web application, I am using a theme to replace the default theme and I would like to use @html.ActionLink() to generate a link. My problem is that the theme requires that I nest another element in the html link tag that will be automatically be generated. How do I nest elements using razor syntax?

Upvotes: 0

Views: 143

Answers (1)

adolja
adolja

Reputation: 189

I don't think that you can nest elements in razor syntax. Solution for your problem would be to use @Url.Action() inside href property of a tag like this:

<a href="@Url.Action( "Action", "Controller")" class="btn btn-info"></a>

Upvotes: 1

Related Questions