user-avatar
Today is Wednesday
May 22, 2013

Category: Development

January 16, 2013

How to get date and month in two digits in JavaScript

by Ashish Sehajpal — Categories: Development — Tags: Comments Off

I beleive no trick is small to not to be shared I needed this in a scenario where i required to show date/month in two digits like 1/1/12 as 01/01/12. use this for Date part i.e. DAY (“0″ + objDate.getDate()).slice(-2) and for MONTH part : (“0″ + (objDate.getMonth() + 1)).slice(-2)

November 1, 2012

C# regular expressions cheat sheet

by Ashish Sehajpal — Categories: Development — Tags: Comments Off

I got it from my colleague and found it very useful and thought of sharing it: Character Description \ Marks the next character as either a special character or escapes a literal. For example, “n” matches the character “n”. “\n” matches a newline character. The sequence “\\” matches “\” and “\(” matches “(“. Note: double [...]

October 19, 2012

Generate C# classes from XML or XSD

by Ashish Sehajpal — Categories: Development — Tags: , , Comments Off

XSD.Exe is the tool to go ahead.   C:\temp>xsd test.xml Microsoft (R) Xml Schemas/DataTypes support utility [Microsoft (R) .NET Framework, Version 4.0.30319.1] Copyright (C) Microsoft Corporation. All rights reserved. Writing file ‘D:\temp\test.xsd’. C:\temp>xsd test.xsd /classes Microsoft (R) Xml Schemas/DataTypes support utility [Microsoft (R) .NET Framework, Version 4.0.30319.1] Copyright (C) Microsoft Corporation. All rights reserved. Writing [...]

September 18, 2012

JSON to .Net Objects – Expecting state ‘Element’.. Encountered ‘Text’ with name ”, namespace ”.

by Ashish Sehajpal — Categories: Development — Tags: , , Comments Off

The tricky error while deserializing the JSON stream to corresponding Dot Net object(s) is very annoying. I spent few hours searching for a viable solution and found the funny issue in what we receive in JSON response. Usually, it happens when the response contains some loose text i.e. no Nodes specified in the JSON format [...]

June 28, 2012

Visualize my resume – Packaging matters

by Ashish Sehajpal — Categories: Development, General — Tags: Comments Off

I have prepared a skeleton of what an ideal resume should look like in visualization point of view. Ever wondered how your profile look like if you want to put some visual content? The full HTML 5 content rendered to any type of browser being a web browser or mobile one. Easy on eyes and [...]

May 30, 2012

Browser Request Headers – useful in web development

by Ashish Sehajpal — Categories: DevelopmentComments Off

The easiest way to render the content according to device request is to check the browser headers in the request. The various browser header values to be compared against are as follows : Internet Explorer IE9 – Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) IE8 – Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; [...]

May 7, 2012

Google Charts Error In IE : Every row given must be either null or array.

by Ashish Sehajpal — Categories: Development — Tags: , Comments Off

Sometimes there is an error while drawing charts from google API in a webpage that says : Every row given must be either null or array. There is a very simple solution to this problem. Usually we create the data rows in this chart via LOOP and forget to remove the comma at the end [...]

April 24, 2012

JavaScript Style Attributes – Essentials

by Ashish Sehajpal — Categories: Development — Tags: , Comments Off

JavaScript Style Attributes Listed below are the tables of CSS properties for various HTML element style attributes. I have added a column indicating the javaScript name that the browser recognizes for these properties. I have only listed those that I know work, but the trend seems to be to use the same name when one [...]

March 14, 2011

How to change calendar icon in telerik asp.net control

by Ashish Sehajpal — Categories: Development — Tags: , Comments Off

It was very hard to find a work around to solve this problem as there was nothing helpful available on internet. Just use the following line of code inside calendar tag i.e. before this line </radcln:raddatepicker>.   <DatePopupButton ImageUrl=”~/RadControls/Calendar/Skins/myStyle/Img/datePickerPopup.gif” HoverImageUrl=”~/RadControls/Calendar/Skins/myStyle/Img/datePickerPopupHover.gif” />

March 14, 2011

How to remove dotted line from HTML link, check box and radio buttons

by Ashish Sehajpal — Categories: Development — Tags: , Comments Off

 Please add the following CSS Styles in your default style sheet or add under style tag in head of the page. input[type="radio"], input[type="checkbox"]{ outline: none; } a{text-decoration: none; outline: 0; }

© 2013 Sehajpal.com All rights reserved - Mobile View