Example of Tile View in ASP.NET MVC Card Control
This sample demonstrates filter and search of the card based on categories, and text containing the card. You can use search box to search cards, and you can filter choosing categories in multi-select component.

ASP.NET MVC
Nick Harrison
ASP.NET Model View Controller design pattern to keep the data, views, and logic clearly separated in apps.

Node.js
Emanuele DelBono
Node.js is a wildly popular platform for writing web applications that has revolutionized web development in many ways.

React.js
Dmitri Nesteruk
React is a JavaScript library that has revolutionized how developers design and think about views in web applications.

TypeScript
Steve Fenton
Microsoft TypeScript extends many familiar features of .NET programming to JavaScript.

PHP
Jose Roberto Olivas Mendoza
Known for its straightforward simplicity, PHP is an open source, general-purpose scripting language oriented for web development.

CSS3
Peter Shaw
In CSS3 Succinctly, author Peter Shaw provides an overview of the latest features available for custom cascading style sheets.

ASP.NET Core
Simone Chiaretta and Ugo Lattanzi
In ASP.NET Core Succinctly, seasoned authors Simone Chiaretta and Ugo Lattanzi update you on all the advances provided by Microsoft’s landmark framework.

Aurelia
Matthew Duffield
Aurelia is a relatively new, open-source JavaScript library/framework that simplifies the creation of web-based applications.

ECMAScript 6
Matthew Duffield
ECMAScript 6 (ES6), also known as ECMAScript 2015, brings new functionality and features to the table that developers have been wanting for a long time.

JavaScript
Cody Lindley
JavaScript Succinctly was written to give readers an accurate, concise examination of JavaScript objects and their supporting nuances.

Knockout.js
Ryan Hodson
Knockout.js Succinctly is intended for professional web developers who need to build dynamic, scalable user interfaces with minimal code.

Angular 2
Joseph D. Booth
Angular 2 is a massively popular JavaScript framework built to take advantage of component development in web apps.
No results found. Please try a different search.
@Html.UiDropDownList("local", new UiDropDownListOptions { Width = "180px", Value = "all", OnChange = "filterTiles", Items = new List<UiListItem> { new UiListItem("all", "All"), new UiListItem("server", "Server"), new UiListItem("client", "Client") } })
@Html.UiCard(new UiCardOptions { Title = book.Title, SubTitle = book.Author, ImageUrl = Url.Content("~/Content/card/" + book.Image), Content = book.Text, Actions = { new UiCardAction { Text = "Read More", Url = book.Href } } })
<style>
.filter-row { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; max-width: 900px; margin: 20px auto; }
.filter-row label { display: block; font-size: 13px; color: var(--ui-muted); margin-bottom: 4px; }
.tile-search { min-width: 240px; padding: 6px 8px; border: 1px solid var(--ui-input-border); border-radius: var(--ui-radius); background: var(--ui-surface); color: var(--ui-text); font: inherit; }
.e-card-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.e-card-layout .tile[hidden] { display: none; }
.tile-none { text-align: center; padding: 40px 0; font-size: 18px; font-weight: 500; }
</style>
@using Lumen.UI.Mvc.Demo.Controllers
<div class="control-section card-control-section tile_layout">
<div class="filter-row">
<div>
<label for="search_Card">Enter text to search</label>
<input type="search" id="search_Card" class="tile-search" autocomplete="off" />
</div>
<div>
<label for="local">Category</label>
@Html.UiDropDownList("local", new UiDropDownListOptions { Width = "180px", Value = "all", OnChange = "filterTiles", Items = new List<UiListItem> { new UiListItem("all", "All"), new UiListItem("server", "Server"), new UiListItem("client", "Client") } })
</div>
</div>
<div class="e-card-layout" id="cardTiles">
@foreach (var book in (List<LayoutDemoController.CardBook>)ViewData["cardBook"])
{
<div class="tile" data-tag="@book.Tag">
@Html.UiCard(new UiCardOptions { Title = book.Title, SubTitle = book.Author, ImageUrl = Url.Content("~/Content/card/" + book.Image), Content = book.Text, Actions = { new UiCardAction { Text = "Read More", Url = book.Href } } })
</div>
}
</div>
<div id="cardTileNone" class="tile-none" hidden>No results found. Please try a different search.</div>
</div>
<script>
// Syncfusion: the text box and the category list filter the cards
var category = 'all';
function filterTiles(value) {
if (typeof value === 'string') { category = value; }
var text = document.getElementById('search_Card').value.trim().toLowerCase();
var shown = 0;
document.querySelectorAll('#cardTiles .tile').forEach(function (tile) {
var match = (!text || tile.textContent.toLowerCase().indexOf(text) >= 0) && (category === 'all' || tile.getAttribute('data-tag') === category);
tile.hidden = !match;
if (match) { shown++; }
});
document.getElementById('cardTileNone').hidden = shown > 0;
}
document.getElementById('search_Card').addEventListener('input', filterTiles);
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class CardController : Controller
{
// The page is Views/Card/TileView.cshtml; it draws what ViewData holds.
public ActionResult TileView()
{
ViewData["cardBook"] = new List<CardBook>
{
new CardBook { Title = "ASP.NET MVC", Author = "Nick Harrison", Image = "Tile_1.png", Tag = "server", Text = "ASP.NET Model View Controller design pattern to keep the data, views, and logic clearly separated in apps.", Href = "https://www.syncfusion.com/ebooks/ASPNET_MVC_Succinctly" },
new CardBook { Title = "Node.js", Author = "Emanuele DelBono", Image = "Tile_2.png", Tag = "client", Text = "Node.js is a wildly popular platform for writing web applications that has revolutionized web development in many ways.", Href = "https://www.syncfusion.com/ebooks/nodejs" },
new CardBook { Title = "React.js", Author = "Dmitri Nesteruk", Image = "Tile_3.png", Tag = "client", Text = "React is a JavaScript library that has revolutionized how developers design and think about views in web applications.", Href = "https://www.syncfusion.com/ebooks/reactjs_succinctly" },
new CardBook { Title = "TypeScript", Author = "Steve Fenton", Image = "Tile_4.png", Tag = "client", Text = "Microsoft TypeScript extends many familiar features of .NET programming to JavaScript.", Href = "https://www.syncfusion.com/ebooks/typescript" },
new CardBook { Title = "PHP", Author = "Jose Roberto Olivas Mendoza", Image = "Tile_5.png", Tag = "server", Text = "Known for its straightforward simplicity, PHP is an open source, general-purpose scripting language oriented for web development.", Href = "https://www.syncfusion.com/ebooks/php_succinctly" },
new CardBook { Title = "CSS3", Author = "Peter Shaw", Image = "Tile_6.png", Tag = "ui", Text = "In CSS3 Succinctly, author Peter Shaw provides an overview of the latest features available for custom cascading style sheets.", Href = "https://www.syncfusion.com/ebooks/css3" },
new CardBook { Title = "ASP.NET Core", Author = "Simone Chiaretta and Ugo Lattanzi", Image = "Tile_7.png", Tag = "server", Text = "In ASP.NET Core Succinctly, seasoned authors Simone Chiaretta and Ugo Lattanzi update you on all the advances provided by Microsoft’s landmark framework.", Href = "https://www.syncfusion.com/ebooks/asp_net_core_succinctly" },
new CardBook { Title = "Aurelia", Author = "Matthew Duffield", Image = "Tile_8.png", Tag = "client", Text = "Aurelia is a relatively new, open-source JavaScript library/framework that simplifies the creation of web-based applications.", Href = "https://www.syncfusion.com/ebooks/aurelia_succinctly" },
new CardBook { Title = "ECMAScript 6", Author = "Matthew Duffield", Image = "Tile_9.png", Tag = "client", Text = "ECMAScript 6 (ES6), also known as ECMAScript 2015, brings new functionality and features to the table that developers have been wanting for a long time.", Href = "https://www.syncfusion.com/ebooks/ecmascript_6_succinctly" },
new CardBook { Title = "JavaScript", Author = "Cody Lindley", Image = "Tile_10.png", Tag = "client", Text = "JavaScript Succinctly was written to give readers an accurate, concise examination of JavaScript objects and their supporting nuances.", Href = "https://www.syncfusion.com/ebooks/javascript" },
new CardBook { Title = "Knockout.js", Author = "Ryan Hodson", Image = "Tile_11.png", Tag = "client", Text = "Knockout.js Succinctly is intended for professional web developers who need to build dynamic, scalable user interfaces with minimal code.", Href = "https://www.syncfusion.com/ebooks/knockoutjs" },
new CardBook { Title = "Angular 2", Author = "Joseph D. Booth", Image = "Tile_12.png", Tag = "client", Text = "Angular 2 is a massively popular JavaScript framework built to take advantage of component development in web apps.", Href = "https://www.syncfusion.com/ebooks/angular2_succinctly" }
};
return View();
}
/// <summary>A card of the Tile View sample: a book, its author, the picture and the group it is filtered by.</summary>
public class CardBook
{
public string Title { get; set; }
public string Author { get; set; }
public string Image { get; set; }
public string Tag { get; set; }
public string Text { get; set; }
public string Href { get; set; }
}
}
}
@* Install once: Install-Package Lumen.UI.Mvc (or: dotnet add package Lumen.UI.Mvc) *@
@* Views/Web.config: <add namespace="Lumen.UI.Mvc" /> *@
@* Views/Shared/_Layout.cshtml *@
<head>
@Html.UiStyles()
<link rel="stylesheet" href="~/Content/site.css" />
</head>
<body>
@RenderBody()
@Html.UiScripts()
@RenderSection("scripts", required: false)
</body>
Card is a small container in which user can show defined content in specific structure and it is flexible and extensible. This sample demonstrates how to render the Card Using Template Engine and how it can be filtered based on data Manager .