While reading a config file which was present in other website from an application I was getting: Error: Cannot read configuration file due to insufficient permissions The reason for this issue was th...
There is different logic to detect IE11 in C#. It can be done via: Regex.IsMatch(current.Request.UserAgent, @"Trident/7.*rv:11") So over all IE detection can be done via: public static bool ...
This can be achieve like this: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> if (!window.jQuery) { do...
Install PHP 5.5.6 on Windows Server 2008 R2 Installing PHP on IIS 7 with Windows server 2008 can be tricky as the instructions mentioned in many official documents do not work with PHP 5.5.6. Here are...
For sample purpose I was using the js references directly from Github i.e I was using this: <script type="text/javascript" src="https://raw.github.com/WickyNilliams/headroom.js/m...
Headroom.js is a lightweight, high-performance JS widget (with no dependencies!) that allows you to react to the user's scroll. The header on this site is a living example, it slides out of view w...
If you want to get first and last date of month based on input date following code will help you: public static DateTime FirstDayOfMonth(DateTime dateTime) { return new DateTime(dateTime.Year, dateTim...
While working with bootstrap 2.3.2 modal I noticed a weird issue with tooltips applied to elements inside that modal. To fix this issue I applied stopPropagation on tooltip element: fragment.find('...
In VS2012 there is preview tab feature i.e when you select any file it is opened and will be placed in the right corner of the tab-well and when you select another file the current file will be closed...
ASP.NET Visual Studio 2012 error: This operation requires IIS integrated pipeline mode.
This is an off-topic post. I had to blog about it because Activision deserves to be slammed for not providing the pause option when playing "extinction" or "squad" offline.
If youhave the bytes with you and want to convert to string in like 10KB, 10MB or 10GB the following code will help you: public static String BytesToString(double byteCount) { string[] suf = { "B...
If you want to add 301 redirects to your site you can do that via web.config. Here is the example: <location path="communifire/technology"> <system.webServer> &am...
Below is the code which can help you to copy all the folders and files of a directory to a backup folder inside it. Let's create a helper class to do the same: #region Using Directives using Syste...
Today I was in a need where I had to get stack trace inside a method. I was not throwing any exception in that method an therefore I was not having any exception object from where I could get the stac...
While working with our application I wanted to list all the stored procedures having some particular text. I decided to share the query which I used to do that: SELECT * FROM sys.procedures WHERE name...
While working with ASP.NET multiline textbox I realized that MaxLength property was not working, it seems it was bypassed by ASP.NET engine. I decided to write a small JavaScript piece of code in orde...
Below is the SQL query to get all constraints: SELECT TableName = t . Name , ColumnName = c . Name , dc . Name , dc . definition FROM sys . tables t INNER JOIN sys . default_constraints dc ON t . obje...
While working with IE7 one of our pages was giving Operation Aborted error. I was getting the following screen: The reason for this error was that I was trying to add new elments to body tag via scrip...
If you want to load external JavaScript file dynamically i.e via JavaScript code you can take help from the following code: var loadJs= function (src, callback) { var s = document.createElement('s...
Below is the query which you can use to shrink the transcation log: USE AdventureWorks2008R2 ; GO -- Truncate the log by changing the database recovery model to SIMPLE. ALTER DATABASE AdventureWorks20...
While working with one of my project I was getting message "Could not load file or assembly 'tika-app, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A...
If you have the image data in System.Drawing.Image and want to bind that to ASP.NET Image control following code will help you: System.Drawing.Image img = System.Drawing.Image.FromStream(xx); // Your ...
If you want to see whether your dll is strongly signed or not you can check that via ildasm . Navigate to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ildasm.exe and open the dll you want t...
If you want to see whether your dll is strongly signed or not you can check that via Reflector . Load your dll in Reflector and focus on PublicKeyToken value. Reflector will show you information like ...