Resize image while uploading image

Namespace required: using System.IO; using System.Drawing; using System.Drawing.Drawing2D; — .cs page coding on Save button—————– // Create a new bitmap which will hold the previous resized bitmap Bitmap newBMP = new Bitmap(originalBMP, newWidth, newHeight); // Create a graphic based on the new bitmap Graphics oGraphics = Graphics.FromImage(newBMP); // Set the properties for the new graphic …

How to remove white space from TEXTAREA?

function removeTextAreaWhiteSpace() { var myTxtArea = document.getElementById(‘txtQuestion’); myTxtArea.value = myTxtArea.value.replace(/^\s*|\s*$/g, ”); } Call above function “removeTextAreaWhiteSpace()” onfocus event of textarea. e.g. onfocus=”removeTextAreaWhiteSpace()”

Change body background on Page Reference

Call javascruot function on body load event… e.g. ” var totalCount = 5; function Test() { // if (document.body) { // document.body.style.backgroundImage = ‘url(images/slideshow1_1.jpg)’; // } var num = Math.ceil(Math.random() * totalCount); if (num == 1) { //document.bgColor = “Red”; document.body.style.backgroundImage = ‘url(images/slideshow1_1.jpg)’; } else if (num == 2) { //document.bgColor = “Yellow”; document.body.style.backgroundImage = …

JQuery Validations

http://www.position-relative.net/creation/formValidator/ Above link includes all validation. Its so pretty web site look like more pretty. Download: https://github.com/posabsolute/jQuery-Validation-Engine or https://skydrive.live.com/?cid=efc0ec2e2cd761ee&sc=documents&nl=1&uc=1&id=EFC0EC2E2CD761EE%21160#

Get URL Parameters (QueryStrings) using Javascript

Get URL Parameters (QueryStrings) using Javascript Nearly all server-side programming languages have built-in functions to retrieve querystring values of a URL. In web browsers you can access the querystring with client-side JavaScript, but there is no standard way to parse out the name/value pairs. So here is a function to return a parameter you specify. …