Wednesday, 25 June 2014

Free .NET decompiler

ILSpy

ILSpy is a free .Net decompiler.

ILSpy requires the .NET Framework 4.0.

Click here to download

Wednesday, 18 June 2014

How to detect IE11 from User Agent?

Pre-IE11 versions of Internet Explorer browser have a common pattern/string i.e. "MSIE" within their user agent string. But that is not the case with IE11.

IE11 user agent string

Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko

IE10 user agent string

Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)

Here is some JavaScript code to identify the version Internet Explorer from user agent string


var isIE11 =  navigator.userAgent.match(/Trident.*rv\:11\./);

var isIEButNotIE11 =  navigator.userAgent.match(/MSIE (\d+\.\d+)/);

This function can be used to get the version number of IE

function IEVersion() {

    var ieversion;

    if (/MSIE (\d+\.\d+);/.test(navigator.userAgent))
        ieversion = new Number(RegExp.$1);
    else if (navigator.userAgent.match(/Trident.*rv\:11\./))
        ieversion = 11;

    return ieversion;
}

What is My User Agent?

I found this website today while I was looking for differences between User Agent value of IE11 and other older versions of IE.

http://www.whatsmyuseragent.com/

When you open the website it will display your user agent string and IP address as well.

Thursday, 29 May 2014

How to create a blank solution in Visual Studio?

Follow these steps to create an empty solution in Visual Studio
  1. On the File menu, click New and then click New Project.
  2. In the left pane, select Installed, select Other Project Types, and then select Visual Studio Solutions from the expanded list.
  3. In the middle pane, select Blank Solution.
  4. Set the Name and Location values for your solution, then click OK.

Monday, 19 May 2014

X-Frame-Options response header

The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe> or <object> . Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.

Using X-Frame-Options

There are three possible values for X-Frame-Options:

  • DENY

    The page cannot be displayed in a frame, regardless of the site attempting to do so.

  • SAMEORIGIN

    The page can only be displayed in a frame on the same origin as the page itself.

  • ALLOW-FROM uri

    The page can only be displayed in a frame on the specified origin.

Read More>>

What is clickjacking?

What is Clickjacking and How can you prevent it?

Modifying multiple CSS properties in one go using jQuery

jQuery .css() method can be used to set one or more CSS properties for every matched element.

Setting single CSS property
 
$('p').css( "background-color", "yellow" );

 

Setting multiple CSS propertes
 
$('div.header').css({"background-color": "yellow","font-weight": "bold" });

 

Read More

jQuery API - .css() Method

www.w3schools.com >>jQuery - css() Method

Thursday, 8 May 2014

Accessing radio button state using jQuery

You can use the .is(selector) function in jQuery to get the state of a radio button.

Example:

$("#radiobuttonid").is(":checked")

$('input[id="group1"]').is(':checked') 

Also

$("#radiobuttonid").attr("checked", true)
sets the state of the radion button to selected.