Object Oriented Programming in JavaScript

In this article I would like to post about the better way to program in JavaScript. First, I would try to list down few concepts about Object Oriented Programming and then  I would try and explain how these concepts can be incorporated in JavaScript. This topic is big in itself so I would break this topic into various articles. Following are the articles related to this topic.

  1. OOP Part 1 – Basics of OOP, how to implement OOPs concepts in JS
  2. OOP Part 2 – Advance concepts of OOPs, how to implement OOPs concepts in JS
  3. OOP Part 3 – Working example of OOP in real world JS.

Continue reading

Call a JavaScript method/code from Asp.Net Code behind

In day to day development, we face a requirement that we need to call a JavaScript method or some lines of JavaScript code from code behind. There are several ways to accomplish this.

  1. Using ScriptManager Class.
  2. Using Page.RegisterClientScriptBlock or Page.RegisterStartupScript or Page.ClientScript object

Page.RegisterClientScriptBlock or Page.RegisterStartupScript methods are deprecated methods and they shouldn’t be used. Microsoft has replaced them with Page.ClientScript object methods.

ScriptManager class can also be used to do the same but with the slight difference, these methods are compatible with Asp.Net AJAX partial post backs where as the Page.ClientScript object methods are not compatible with Asp.Net AJAX.

Continue reading