I\'m using MVC3 and I wanted to use a partial view to create dynamic DOM elements. This is my current partial view:
@model MVCApp.ViewModels.TitlesViewModel
<
Just adding another option as this is what worked for me when trying to concat string and model value as id in an @html.ActionLink and also for the text value. I needed to use string.Concat. Don't know if this is bad from a performance point of view.
@Html.ActionLink(string.Concat("View all (", @Model.FooCount, ")"),
//actionName
"SeeAllFoos",
//ControllerName
"Foo",
// routeValues
new { FooId = @Model.Foo.id },
//htmlAttributes
new { @class = "btn btn-success", onclick = "ShowProgress();",
id = string.Concat("Foo",@Model.Foo.id.ToString()) })