
Javascript Trim, Left Trim & Right Trim Functions
Javascript string property does not have the normal trim functions like we have in any other language. And these trim functions appears play a crucial role in any code based on strings. There are two approaches i give here. One is directly creating a prototype method and other as a standalone function. You can choose ...

Maintain scroll position on postback for gridview or div
Problem Statement: There can be scenarios wherein your end users would appreciate to see the screen intact even after postback. In ASP .Net we use the MaintainScrollOnPostback property for the page to handle the page's scroll position. But this will not handle the case when you have gridviews wrapped in divs and having a scroll ...

Coma getting added in a textbox, placed inside an update panel, on prefill
Problem: A comma is getting appended to a textbox (textbox needs to be inside an update panel), each time a partial refresh happens in that page. Solution: The issue happened especially when i was populating the textbox, from the query string. Most importantly duplicate entries in the query string. ex: www.xyz.com?id=123 & val=rrq & id = & ...

Encrypting and Decrypting passwords in SQL server
We have come across scenarios wherein highly sensitive information like passwords being stored in our database. It is a highly likely chance that during SQL Injection or unprecedented attacks, these table values gets exposed. I will explain here a simple means of encrypting, followed by decrypting the same password for user authentication. But let me ...

Javascript pause method: To create delays in javascripts
Creating delays in javascript can be very essential under certain specific scenarios, though i would recommend you to avoid it in most cases. The right way to create a delay would be by using setTimeOut method in javascript, as below: setTimeout("alert('hello world')",1500); // shows alertbox after 1500 milliseconds The lazy way or to be precise ...

How to enable javascript in various browsers – help file
This is a help reference for those sites, which are javascript critical. You can use this in a page to which you redirect in your javascript disabled scenario. Microsoft Internet Explorer 1. On the Tools dropdown menu, click Internet Options, and then click the Security tab. 2. Click on the earth «Internet» icon, and then ...