Tuesday, October 20, 2009

JavaScript

Some Javascript scripts that are always useful:

1) Disabling an item in a dropdown list:



2) Restriction in number of characters or lines in a multiline textbox



3) Blocking the right click / left click



To call it:
onMouseDown="whichButton(event)"

4) Cleaning the clipboard:

Encoding Problems

Sometimes we have trouble handling strange characters that must be transferred from one page to another. In general, should we have the habit of transferring strings using encode. In ASP.Net we do so like this:



To Recover this value, we do not need to do anything special just:



References:
http://msdn.microsoft.com/en-us/library/zttxte6w.aspx
http://www.w3.org/International/tutorials/tutorial-char-enc/