Monday, November 25, 2013

Get Registry key value for 32 and 64 bit machines

0 comments
Here is the snippet that pulls a LOCALMACHINE\SOFTWARE

Read more...

Binding html select using knockoutjs and asp.net mvc

1 comments
Suppose we have a ViewModel like this


The markup to populate HTML Select should be


Read more...

Tuesday, November 5, 2013

Server side paging, filtering and sorting using datatables

4 comments
Nothing better than writing some code to explain a feature. This post shows how to do server-side paging in a table using datatables.net
The idea is to display a table with a large amount of data (68k rows). As it's not a good practice to load all at once, it' better to implement server-side paging.

First download datatables.net from here and reference them in your html file.

In our sample we are using a table Tasks with 3 fields, ie, TaskID, TaskName, Complete

Lets create the HTML markup first



Now lets wire up datatable to the table



Here as you can see TaskID and TaskName are sortable and searchable.
Now, the model that is passed from datatables to server-side



Finally, the controller method


That's all to it. Happy coding!

Read more...