Posts Tagged ‘JavaScript’

Javascript Alert Message

Wednesday, March 19th, 2008

How to show javascript alert message from code behind? You probably know, we can do it like this:
ClientScript.RegisterStartupScript(Page, “message”, “alert(’Hellow world!’);”, true).

However this method is not going to work in AJAX environment. For AJAX you need to use: ScriptManager.RegisterStartupScript.

Here is a little utility method, which displays javascript alert message both in AJAX environment and on regular page:
(more…)

Really simple validation

Monday, March 10th, 2008

Recently, we stumbled upon the javascript validation library from LiveValidation and started using it for a variety of projects including AmyK.com and La Casa Del Zorro . Use of this library makes the tedious task of creating validation code really easy. It has extensive features like custom error messages, support for regular expressions and support for custom validation functions.

Previously, we had experimented with a library from http://tetlaw.id.au/upload/dev/validation/ for the Hertz website. That library was based on Prototype JS and scriptaculous but had limitations resulting in workarounds.
(more…)