Single page Web applications are becoming more and more frequent. There are a lot of frameworks/technologies that make the development of these applications a lot easier. You can use JQuery to manipulate your page, use Knockout.js to work the ViewModel way and use WebApi to get your data. All these tools make a fine toolbox to create responsive, single page web applications.
But how about the navigation in these applications? How can this be done in a pluggable, centralized way? You can easily create a JavaScript function on your page that will accept an...
2015-12-02
Navigation in a Single page Web application: Sammy.js
Posted by
Kenny Tordeur
,
at
Wednesday, December 02, 2015

2014-01-27
I moved
Posted by
Kenny Tordeur
,
at
Monday, January 27, 2014
Recently i decide to move my blog to my own domain. You can now find me at http://kennytordeur.be
Happy readings ...
2012-12-21
Asp.net MVC MEF: Per Request Lifetime
Posted by
Kenny Tordeur
,
at
Friday, December 21, 2012
Like the title says, i want to use MEF in an Asp.Net MVC application and the lifetime of the object has to be exactly the same as the lifetime of the request. In short, i want 1 single unique object that is recreated per request. In MEF there is a way to control the lifetime of the created object. This is specified the PartCreationPolicy attribute that you can use to decorate the object. In my test project i installed the nuget package i created in this post to incorporate MEF in an Asp.net MVC application. I also created an object called MyCustomObject...
2012-12-16
Asp.net MVC: reuse Areas from external project
Posted by
Kenny Tordeur
,
at
Sunday, December 16, 2012
I created a MVC project that has an Area defined that i would like to use in an other MVC project. Here is the structure. I created a reference between the AlphaArea and MainApp project. When i run the application is see that the area registration of the AlphaArea is executed. But when i try to go to the area i get an error. What this error says, is that the view for the Index of the AlphaController in the Alpha area isn’t found. This makes perfect sense because the Index view isn’t declared in the MainApp project and this is where MVC tries to...
2012-12-12
Web Api: Passing a Complex type in JSON
Posted by
Kenny Tordeur
,
at
Wednesday, December 12, 2012
In one project i wanted to pass a complex type to the Post method of an Web Api controller. The Post itself will be done using JQuery in the JSON format. I noticed that the parameter was always null. After a bit of searching i found the solution. The Set Up Server side public class ValuesController : ApiController { // POST api/values public void Post(MyComplexType value) { } } public class MyComplexType { public string Name { get; set; } public MyComplexSubType MyComplexSubType { get; set; } ...
2012-12-07
WebApi: File upload and download using JQuery and submit button
Posted by
Kenny Tordeur
,
at
Friday, December 07, 2012
I am going to create a WebApi service called FileService that can be used to upload and download files. The service will only contain 2 methods. A Post to upload and a Get method that accepts an id parameter to identify the file that needs to be downloaded. Let’s start with the Post method. The Post method This method will look in the Request object to see if there are any posted files. If so, it will loop over the files and create them on the server side. The server will return a 201 HttpStatus and a list of strings that will contain the full path of the...
2012-12-01
Paged Grid with Knockout.js and WebApi
Posted by
Kenny Tordeur
,
at
Saturday, December 01, 2012
I want to see how easily you can create a custom grid that uses an WebApi as datasource and that allows the user to page the data and also allow them to choose a page size for the grid.
The WebApi
The WebApi will return a viewmodel that contains an array of names (string) and a property that specifies how many pages that there are available.
public class NamesGridViewModel
{
public IEnumerable<String> Names { get; set; }
public int NumberOfPages { get; set; }
}
The WebApi itself will contain a method that accepts 2...
Subscribe to:
Posts (Atom)