Skip to main content

Posts

Popup form on Screen Center Javascript

Popup Form on Center  to popup the form on Screen Center use the below Script Example : <script language="javascript"> var popupWindow = null; function centeredPopup(url,winName,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' popupWindow = window.open(url,winName,settings) } </script> <p><a href="http://www.quackit.com/common/link_builder.cfm" onclick="centeredPopup(this.href,'myWindow','500','300','yes');return false">Centered Popup</a></p>

Using RNGCryptoServiceProvider and Character Masking

Uniquekey Generate Method Code : using System.Security.Cryptography; import the above class for using the code private string GetUniqueKey()   {   int maxSize  = 8 ;   int minSize = 5 ;   char[] chars = new char[62];   string a;   a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";   chars = a.ToCharArray();   int size  = maxSize ;   byte[] data = new byte[1];   RNGCryptoServiceProvider  crypto = new RNGCryptoServiceProvider();   crypto.GetNonZeroBytes(data) ;   size =  maxSize ;   data = new byte[size];   crypto.GetNonZeroBytes(data);   StringBuilder result = new StringBuilder(size) ;   foreach(byte b in data ) { result.Append(chars[b % (chars.Length - 1)]); }    return result.ToString();   } Generation Method Time Taken Number of Generated Keys Number of Duplicate Keys...

Get Query String Values by Javascript

Get Query String Values by Javascript Script Function function GET () { var data = []; for ( x = 0 ; x < arguments . length ; ++ x ) data . push ( location . href . match ( new RegExp ( "/\?" . concat ( arguments [ x ], "=" , "([^\n&]*)" )))[ 1 ]) return data ; } Example : data = GET ( "id" , "name" , "foo" ); query string : ? id = 3 & name = jet & foo = b returns : data [ 0 ] // 13 data [ 1 ] // jet data [ 2 ] // b or alert ( GET ( "id" )[ 0 ]) // return 3

Introduction Basic Concepts of Oops

Introduction Basic Concepts of Oops: Encapsulation and inheritance these are the basic concepts of Object Oriented Programming. I wrote it for those who don't have basic concepts of oop, and for those who feels programming a big monster. I tried to make them understand as much easiest. Introduction In this article i would like to describe the people what are the basic concepts of Object Oriented Programming The OOP stands on the following three pillars. Object &Class (Encapsulation) Inheritance Polymorphism 1 Object & Class (Encapsulation):                   Object: The Object is an Instance in programming language which is made by inspiring from the real world which contains some properties and methods. Lets take an example of a person(object) from the real world. A person is an   object,   as i told you before that an object could   h...

Calculate No of Years,Months and Days Between two Dates by Javascript

Calculate No of Years,Months and Days Between two Dates by Javascript <script language="JavaScript"><!-- //function getAge(dateString,dateType) function CalbwDates() { /*    function getAge    parameters: dateString dateType    returns: boolean    dateString is a date passed as a string in the following    formats: Types :    type 1 : 19970529    type 2 : 970529    type 3 : 29/05/1997    type 4 : 29/05/97    dateType is a numeric integer from 1 to 4, representing    the type of dateString passed, as defined above.    Returns string containing the age in years, months and days    in the format yyy years mm months dd days.    Returns empty string if dateType is not one of the expected    values. */ //var FirstDate=document.getElementById('ctl00_ContentPlaceHolder1_TextBox1').value; //var SecondDate=...

convert amount to rupees in words format in c#

convert amount to rupees in words format in c# public string words ( int numbers )         {             int number = numbers ;             if ( number == 0 ) return "Zero" ;             if ( number == - 2147483648 ) return "Minus Two Hundred and Fourteen Crore Seventy Four Lakh Eighty Three Thousand Six Hundred and Forty Eight" ;             int [] num = new int [ 4 ];             int first = 0 ;             int u , h , t ;             System . Text . StringBuilder sb = new System . Text . StringBuilder ();             if ( number < 0 )             {                 sb . Append ( "Minus " );     ...