JavaScript (6)


Pitfalls of Building Ajax Grid with ASP.NET MVC and jQuery/JavaScript

This article is about pitfalls which should be considered when you’re implementing an Ajax grid with jQuery and ASP.NET MVC. The sample in the article can be used as a starting point to more complicated version of any grid since it provides a complete set of required features: create, edit, delete, filtering, sorting and pagination. […]




Passing AntiForgeryToken to every POST request

The best practice is that all POST request has AntiForgeryToken to prevent XSS attack. If you don’t know what it is, please, read materials in the bottom of the article. From MVC 3.5 there is a special attribute which can be applied to controller actions ValidateAntiForgeryTokenAttribute. It works in pair with HtmlHelper method Html.AntiForgeryToken(). The value […]




Add or update URL query parameter in JavaScript

Add or update URL query parameter with respect to number of parameters and its position.




JavaScript string format

JavaScript has no built-in function to formatting strings, like C#  string.Format(). This function solves the issue adding missing functionality.




Post JSON objects with nested classes to MVC action

Default view model binding of ASP.NET MVC has a disadvantage when using view models with nested classes and JSON objects. The binding is unable to recognize such nested classes and it initializes them to NULL value. This text describes a cause and solutions.




Debugging JavaScript: object dump

From time to time you want a dump of an object during execution of JavaScript code. This function provides missing functional.