Links
@(await Html
.SimpleGrid(Model.Take(3))
.AddColumn(col => col
.For(movie => movie.Name)
.Header("Movie")
.LinkTo(model => GoogleSearchLink(model.Name)))
.AddColumn(col => col
.Display("Google Search")
.LinkTo(
linkBuilder: model => GoogleSearchLink(model.Name),
target: "_blank",
css: css => css.AddClass("btn btn-sm btn-primary")))
.RenderAsync())
string GoogleSearchLink(string query)
{
string encoded = System.Web.HttpUtility.UrlEncode(query);
return $"https://www.google.com/search?q={encoded}";
}