Loading ...

ASP.NET Blogs | CodeAsp.Net - Page 4

  • Increase the font size of Firebug
    If you are struggling with the small font size Firebug don't worry it has solution. It is configurable. This can be done via clicking firebug icon and then selecting the menu as shown in image:
    Raghav Khunger  · 12/25/2013  · 0  · 1207
    firebug
     /5
    Avg: 0 / 5 (0votes)
  • There are situations when you have very large .sql files and you want to execute them. The issue comes when you have to open those files in SSMS. They start giving out of memory exceptions. The solution is to use sqlcmd utility to run the same. You can execute them like below: sqlcmd -S localhost -d master -i "C:\Software\script.sql" -a 3
    Raghav Khunger  · 12/22/2013  · 0  · 1204
    sqlcmd
     /5
    Avg: 0 / 5 (0votes)
  • Generate SQL Server 2008 R2 compatible script from SQL Server 2012
    If you have SQL Server 2012 and want to create Schema and data script for SQL Server 2008 R2 you can follow the following steps: Right click the DB. Select "Generate Scripts" Go to Set Scription options and click "Advance options" and then select "SQL Server 2008 R2" value for "Script for Server Version" opti
    Raghav Khunger  · 12/21/2013  · 0  · 1025
    sql-server-2008-r2 sql-server-2012
     /5
    Avg: 0 / 5 (0votes)
  • If you are using SQL Server Management Objects (SMO) and want to take backup of a database the following code will help you: private static void BackupDatabase(string dbName, string backupPath) { // Fetch the server name from web.config connection string. string serverName = new SqlConnection(SQLHelper.GetConnectionString()).DataSource; // Create t
    Raghav Khunger  · 12/15/2013  · 0  · 1663
     /5
    Avg: 0 / 5 (0votes)
  • You all might be familiar with Assembly.LoadFrom method which can be use to get the version of the assembly but this method has a disadvantage as it will load the assembly into the domain and you will not be able to update that assembly after loading the assembly until the current app domain is unloaded. The solution is to use AssemblyName.GetAssem
    Raghav Khunger  · 12/15/2013  · 0  · 1262
    reflection
     /5
    Avg: 0 / 5 (0votes)
  • IIS: Cannot start service W3SVC on computer '.'
    On starting IIS on my machine I was getting Cannot start service W3SVC on computer '.' message: The solution was to run the following command via command prompt: net start w3svc After running the above command I was able to start the IIS
    Raghav Khunger  · 12/15/2013  · 0  · 2454
    iis7
     /5
    Avg: 0 / 5 (0votes)
  • I was creating sql backup via an ASP.NET application. On running the code written for creating backup I was getting the following exception: Backup Failed for Server 'xxxxx' Operating system error 5: Access is denied The error represents that we do not have permission to create backup at desired destination. But the question was to which ac
    Raghav Khunger  · 12/15/2013  · 0  · 1703
    sql-server-backup
     /5
    Avg: 0 / 5 (0votes)
  • I was working with a project using SQL Server SMO to connect/communicate with SQL server. For that I needed SQL Server SMO dlls. After struggling a bit I was able to locate it and the path for those dlls is: C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies Below is the screenshot for it:
    Raghav Khunger  · 12/15/2013  · 0  · 1282
    sql-server-smo
     /5
    Avg: 0 / 5 (0votes)
  • Error: Cannot read configuration file due to insufficient permissions
    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 that the App Pool identity of the application from which I was trying to read the config file was "Network Service: The solution was to change the
    Raghav Khunger  · 12/15/2013  · 0  · 1933
    iis-7 iis-7.5
     /5
    Avg: 0 / 5 (0votes)
  • 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 IsIE() { HttpContext current = HttpContext.Current; return current.Request.Browser.Browser == "IE" || Regex.IsMatch(current.Request.UserAgen
    Raghav Khunger  · 12/12/2013  · 0  · 5363
    ie internet-explorer-11
     /5
    Avg: 0 / 5 (0votes)
  • 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) { document.write('<script src="/path/to/your/jquery"><\/script>'); } </script>
    Raghav Khunger  · 12/12/2013  · 0  · 1046
     /5
    Avg: 0 / 5 (0votes)
  • 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 the steps to install PHP 5.5.6 on Windows 2008 R2: 1. Download latest version of PHP from here: http://windows.php.net/download/ Make sure you downlo
    Vivek Thakur  · 12/12/2013  · 0  · 4425
     /5
    Avg: 0 / 5 (0votes)
  • Using JavaScript file hosted on github: Refused to execute script from 'xxx' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
    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/master/src/jQuery.headroom.js"></script> <script type="text/javascript"> And after running the page h
    Raghav Khunger  · 12/12/2013  · 0  · 3051
    github
     /5
    Avg: 0 / 5 (0votes)
  • How to use Headroom.js
    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 when scrolling down and slides back in when scrolling up. Below is the js fiddle how to use it: http://jsfiddle.net/raghav_khunger/d7QQ8/2/ You just ne
    Raghav Khunger  · 12/12/2013  · 0  · 20149
    jquery headroom.js
     /5
    Avg: 0 / 5 (0votes)
  • 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, dateTime.Month, 1); } public static DateTime LastDayOfMonth(DateTime dateTime) { var firstDayOfTheMonth = new DateTime(dateTime.Year, dateTime.Month, 1); ret
    Raghav Khunger  · 12/5/2013  · 0  · 1644
     /5
    Avg: 0 / 5 (0votes)
  • 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('a').tooltip().on('show', function (e) { e.stopPropagation(); }).on('hidden', function (e) { e.stopPropagation(); });
    Raghav Khunger  · 11/28/2013  · 0  · 1622
     /5
    Avg: 0 / 5 (0votes)
  • 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 and the new file will be placed in the right corner: This feature is good in some scenarios but in my case I wanted to disable this feature because o
    Raghav Khunger  · 11/27/2013  · 0  · 1427
    visual-studio-2012
     /5
    Avg: 0 / 5 (0votes)
  • ASP.NET Visual Studio 2012 error: This operation requires IIS integrated pipeline mode.
    Vivek Thakur  · 11/25/2013  · 0  · 9658
     /5
    Avg: 0 / 5 (0votes)
  • 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.
    Vivek Thakur  · 11/16/2013  · 0  · 2848
    asp.net c#
     /5
    Avg: 0 / 5 (0votes)
  • 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", "KB", "MB", "GB", "TB", "PB", "EB" }; // Longs run out around EB if (byteCount ==
    Raghav Khunger  · 11/13/2013  · 0  · 3309
    bytes-to-string
     /5
    Avg: 0 / 5 (0votes)
  • 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> <httpRedirect enabled="true" destination="/product/technology" httpResponseStatus="Permanent" /> </sys
    Raghav Khunger  · 11/12/2013  · 0  · 1895
    web.config 301 301-redirect url-rewrite
     /5
    Avg: 0 / 5 (0votes)
  • 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 System; using System.Collections.Generic; using System.IO; using System.Linq; #endregion public static class FileHelper { public static void BackupDirector
    Raghav Khunger  · 10/30/2013  · 0  · 5351
    c# directory-info
     /5
    Avg: 0 / 5 (0votes)
  • 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 stack trace so I used the following method which will give the stack trace in string: public static string StackTraceToString() { var sb = new StringBuild
    Raghav Khunger  · 10/17/2013  · 0  · 1643
     /5
    Avg: 0 / 5 (0votes)
  • SQL: Search stored procedures by names
    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 LIKE '%message%' After running the above query on msdb I got the following output:
    Raghav Khunger  · 10/8/2013  · 0  · 1734
    Sql
     /5
    Avg: 0 / 5 (0votes)
  • 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 order to apply character limit on the textarea. Below is the code for it: $(function () { var summaryControl = $("#Summary"); var maxLength = 10
    Raghav Khunger  · 9/29/2013  · 0  · 2198
    asp.net javascript jquery
     /5
    Avg: 0 / 5 (0votes)
Clear filter

Filter blogs

Top Producers

Quick Vote

What kind of email newsletter would you prefer to receive from CodeAsp.Net?