Here is a basic skeleton of a jquery plugin I have been using. I user an object literal to organize all functions and variables. All the initializations that take place in document.ready are kept inside the init function. All the… Read more ›
I recently switched from sql server 2005 to sql server 2008. A while ago when I tried to change a table column, i encountered an error not allowing me to save the changes. After some time of googling I found… Read more ›
IE has always been giving us a hard time working with the web. 80% of the cross browser incompatibility issues are those which arise when we try to make our site run seamless in IE. However even this deviation has… Read more ›
Responsive design is a big buzz in the web world these days. Responsive design, put simply is just away to get the layout automatically adjust to the screen of the device which we are using which could be a pc,… Read more ›
When we are using form authenticaton in asp.net, the simple way to handle login is to set the form authentication cookie. A simple code snippet to do so is given below FormsAuthentication.SetAuthCookie(UserName.Text, RememberMe.Checked); This sets the user credentials to the… Read more ›
A while ago I ran into a scenario where I had to pass null values to the stored procedures in SQL database. I tried to pass null values by using Nullable int variables. However that would return the error saying… Read more ›
When we are using colorbox in asp.net , the asp.net button doesn’t “postback”. This is because, the colorbox appends the “contents to be displayed inside the box” outside the form tag due to which runat server controls do not seem… Read more ›
Here is a simple way to merge multiple rows into a single row using SQL coleasce DECLARE @compositestr VARCHAR(100) select @compositestr=COALESCE(@str+’/', ”) + cast(MenuID as varchar(20)) from Items where ID=1 select ISNULL(@compositestr,0) AS ItemsMerged The result before merge looked like… Read more ›
Here is a simple way to compare two arrays in c#. public static bool AreArraysEqual(T[] arr1, T[] arr2) { Array.Sort(arr1); Array.Sort(arr2); if (ReferenceEquals(arr1, arr2)) return true; if (arr1 == null || arr2 == null) return false; if (arr1.Length != arr2.Length)… Read more ›
When working with jquery ui dialog I faced a weird problem of the page scrolling to top all by itself. I hooked a click event to an html anchor which opened a jquery dialog. When ever i clicked the anchor,… Read more ›