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. …

Build an EntityConnection Connection String (edmx) model connectionstring

Change edmx model connectionstring dynamically in class library (Data Access Layer) // Specify the provider name, server and database. string providerName = “System.Data.SqlClient”; string serverName = “.”; string databaseName = “AdventureWorks”; // Initialize the connection string builder for the // underlying provider. SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder(); // Set the properties for the data source. …

Calculate duration of time in crystal reports

Create one formula field give name “tot_seconds” local stringvar array completetime; local numbervar totalseconds; if({dtAttendance.Time}”N/A”) Then ( completetime:=split({dtAttendance.Time},”:”); totalseconds:= ((3600*cdbl(completetime[1])) + (60*cdbl(completetime[2]))+(cdbl(“00”))); ) {dtAttendance.Time} time is a report field which is display time in report. If Check In times agains chechout time not found then display ‘N/A’ and vice versa so that we haven’t calculate …

Create or Remove HTML controls dynamically using javascript

Download Source code: live.com = create-remove-control.zip Create file input control using javascript function addFileUploadBox() { if (!document.getElementById || !document.createElement) return false; var uploadArea = document.getElementById(“upload-area”); if (!uploadArea) return; var newUploadBox = document.createElement(“input”); // Set up the new input for file uploads newUploadBox.type = “file”; newUploadBox.size = “70”; // The new box needs a name and …

Clear HTML File Input

HTML file … … – javascript function function clearFileInput() { var oldInput = document.getElementById(“fileInput”); var newInput = document.createElement(“input”); newInput.type = “file”; newInput.id = oldInput.id; newInput.name = oldInput.name; newInput.className = oldInput.className; newInput.style.cssText = oldInput.style.cssText; // copy any other relevant attributes oldInput.parentNode.replaceChild(newInput, oldInput); }

User Dynamic query for search records and use uniqueidentifier

Declare @SearchText nvarchar(max) set @SearchText = ‘sah.CheckInCheckOutDateTime>=”2011-09-28 10:00:00.000”’ Declare @SchoolYearId uniqueidentifier set @SchoolYearId=’25511F7F-8F87-4085-A242-2004F4419D36′ Declare @Str as nvarchar(max) set @Str=’ select s.LastName +”, ” + s.FirstName as ”Name”,CheckInCheckOut,sah.CheckInCheckOutDateTime as ”ClockOut” from StaffAttendenceHistory sah join Staffschoolyear ssy on sah.staffschoolyearid = ssy.id join Staff s on ssy.staffid = s.id where ssy.SchoolYearId=@i’ If(LEN(ISNULL(@SearchText,0))>0) set @Str = @Str + ‘ …

Attendance Reports CheckIn CheckOut in SQL Server

declare @tb1 table (Id int identity(1,1), Name nvarchar(50), CheckInCheckOut bit, CheckInCheckOutDateTime datetime) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)Values(‘Poter, Harry’,1,’2011-08-30 17:00:15.090′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,0,’2011-08-30 17:00:20.140′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,1,’2011-08-30 17:00:24.890′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,0,’2011-08-30 17:00:29.983′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,1,’2011-08-31 17:00:38.983′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,0,’2011-08-31 17:00:44.967′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,1,’2011-09-01 17:00:54.950′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,0,’2011-09-01 17:01:03.590′) –insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, …