Jul 10, 2016

JavaScript Promises: Understanding Error Handling with Example

Promises are an alternative to callbacks for delivering the results of an asynchronous computation. All modern browsers have native support for Promises in JavaScript. In this post, we will see how error handler works with JavaScript chain promises. Before we get started, let’s see how to create a promise:

Mar 1, 2015

How React.js is good for SEO (Server-side React with ASP.NET)

The problem with the javascript frameworks is that they are NOT perfect search engine friendly. Although Google can crawl and index Ajax content but it is not so reliable and need to follow the guidelines. The advantage of React.js is that you can run it on the server and the virtual DOM will be rendered and returned to the browser as a regular web page. In this post, we will implement a sample in ASP.NET to pre-render the initial state of your React components server-side and the outcome is already rendered page of markup. So it will be indexed just like any other static page by search engine.

If you are new to React.js, I strongly recommend to read following tutorial:

React.js: Introduction and Hello World with ASP.NET MVC 5

Aug 30, 2014

Google Chart: Dynamic Data Series from a Column in JavaScript Array

The simplest way to draw Google chart is to create simple JavaScript array of data, Convert to dataTable using arrayToDataTable method, pass it in chart.draw method. But what would happen if you have a array of 3 columns and you have to add series dynamically based on a particular column? In this case, you don’t know about the number of series, it is based on the values of the column. Let us take following JavaScript array as an example:

Jan 12, 2012

Dynamically Enable or Disable ASP.NET Validator and Page.IsValid

In my post, I discussed different client side APIs and Methods of asp.net validator Controls. Now suppose if you have customized validation on client side, what’ll happen on server side? We need to do same on server side. Let’s understand this step by step by taking same example. Suppose you have to disable password’s requiredfieldvalidator when ‘Allow me‘ checkbox is true. You have disabled validator on checkbox click using ValidatorEnable javascript method. Now on server side button click, if you validate and check for isValid, it is always false and you will see error message in validationsummary even if checkbox is checked. Client side bypasses validation but on server side it’s stucked and our object is defeated.

Dec 4, 2011

FEDe: A Search engine for Front-End (HTML, CSS, Javascript & jQuery) Web developers

Generally, A Web developer or designer want to search in his/her favorite sites first, but too complex to search in individual site one by one. Being a Front-End developer, I decided to create a search engine based on top sites, forums and blogs for HTML, CSS, Javascript and jQuery. After NetBrij(A Search engine for .NET developers), BrijPad(An online text editor for fast development), The next is FEDe (free from ‘Brij’ keyword :)). It’s a search engine for Front-End (HTML, CSS, Javascript & jQuery) Web developers based on Google CSE.

Nov 1, 2011

jQuery Date Range Picker To Select Year, Month Or Quarter Only

This article explains how to implement custom date range picker to select year, month or quarter only (Generally used in reporting) and get start date and end date of user selected value. We will use daterangepicker jQuery-Plugin by filamentgroup. I see jQueryUI DatePicker but it’s little bit complicate.

Sep 17, 2011

Naming Conventions & Coding Standards for .NET Web Developers

Naming conventions in programming languages have potential benefits to reduce the effort needed to read and understand source code and provide better understanding in case of code reuse after a long interval of time. It’s a initial step for beginner to learn any programming language and It later becomes a habit. Here are some good resources for .NET web developers.

Sep 10, 2011

Client Side Validation using ASP.NET Validator Controls from Javascript

ASP.NET validation controls provide functionality to perform validation using client script. By default, when client-side validation is being performed, the user cannot post the page to the server if there are errors on the page thus the user experience with the page is enhanced.

Jun 3, 2011

JSON Response of different .NET objects

JSON (JavaScript Object Notation) is a human-readable data interchange format which is based on collection of name/value pairs and ordered list of values. These days, Due to more use of AJAX and client side scripting, JSON is widely used to interact with the server as request response format.

Jun 2, 2011

Javascript Backreferences: String Replace with $1, $2…

Learn how to manipulate string easily using javascript back-references. JavaScript has a regular expression object, RegExp provides group functionality by placing part of a regular expression inside round brackets or parentheses. Groups are more powerful because by default these are captured and stored in array(back reference array) and we can use the array later in regular expression for exact matching. Let us understand this by examples: