a developer's notes – a semi-technical web development BLOG

January 22, 2015

Cookie Tempdata Alerts with ASP.NET MVC

Filed under: ASP.NET MVC — Duy Nguyen @ 10:19 pm
Tags: , , ,


A sample MVC Project using the CookieTempDataProvider and Bootstrap alerts. This project will illustrate how to add notifications on the serverside and client side via javascript.

Add the CookieTempDataProvider code We used the CookieTempDataProvider from:

Add a basecontroller that uses the CookieTempDataProvider
Added Bootstrap to project using NuGet for styling -(Added the reference to bootstrap.js and bootstrap.css in the _Layout.cshtml file.
Added notification icons (used http://www.famfamfam.com/lab/icons/silk/)
In _Layout.cshtml, moved the scripts into the tag (so that jquery will work) @Scripts.Render(“~/bundles/jquery”) @RenderSection(“scripts”, required: false)


Create a free website or blog at WordPress.com.