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: , , ,

https://github.com/duyn9uyen/CookieTempDataProvideAlerts

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:
https://github.com/KunleSmart/MvcExtensions/blob/master/src/CookieTempDataProvider.cs

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)

Advertisements

Blog at WordPress.com.