Tag: asp.net

Running a background thread inside an ASP.NET website

When most people think of a web site or web application they think of something that respond to user navigations. The site has a life cycle that begins when the call comes in and ends when the response has been returned. Between these users calls the site is dead. But in reality it’s possible to




Extend MVC controller to support Toastr messages

In an earlier post I showed how to create an MVC wrapper for Toastr, a JavaScript library used for displaying user messages in the web browser. In the post I mentioned that there are two ways to make it possible to call an AddToastMessage function directly from the action methods in the controller: Implement an




Create an MVC wrapper for Toastr

Toastr is a great little library for creating user messages on your website. It’s written in JavaScript and is as such platform independent. But if you’re like me (mainly working in ASP.NET MVC) then creating a server side extension to get messaging support directly in your controllers, could be something to consider. The code shown




Using Json.NET as default JSON serializer in MVC

Returning JSON from an MVC action method is very easy. Just look at this simple example: public JsonResult GetItemData(int itemId) { // …things to do… var response = new { result = “ok” }; return Json(response); } Serialization of the object into JSON is taken care of by ASP.NET in the background and you can




%d bloggers like this: