Monthly Archives: August 2013

IIS 7.5 first request very slow

This is somewhat hard to tell whats going on on your other server, however here’s a simple checklist you might want to reconsider:

  1. Always pre-compiling your site, as opposed to copying it! you might gain a significant performance boost compiling your website before deployment: ASP.NET Precompilation Overview
  2. Do not run the production application with debug=”true” enabled, when debug flag is true in your web.config, Much more memory is used within the application at runtime, and since some additional debug paths are enabled, codes can execute much slower
  3. Check your Web.config file to ensure trace is disabled in the section
  4. IIS 7.5 comes with the Auto-Start Feature. WAS (Windows Process Activation Service) starts all the application pools that are configured to start automatically, ensure that your application pool is configured to AlwaysRunning in the IIS 7.5 applicationHost.config, check out here for more detail
  5. Check out the ASPNET.CONFIG file to see if the configuration on both servers are still the same. Every asp.net server can be well configured by aspnet.config file located in the root of the framework folder
  6. Ensure that Publisher Evidence for Code Access Security (CAS) is set to false in your aspnet.config file, This might increase the initial page load when you restart the ASP.NET app pool. you can read more about it here.Here’s how to disable checking for CAS publisher policy for an application:
    <configuration>
        <runtime>
            <generatePublisherEvidence enabled="false"/>
        </runtime>
    </configuration>
    
  7. also you might want to try Application Initialization Module for IIS 7.5, this module also available on IIS 8.0 can decrease the response time for first requests by pre-loading worker processes

Source: Stack Overflow

jQuery – focus on next input

HTML

<asp:TextBox ID="txtPostalCodeFSA" runat="server" CssClass="postalCode" MaxLength="3" />
<asp:TextBox ID="txtPostalCodeLDU" runat="server" CssClass="postalCode" MaxLength="3" />

jQuery

$(document).ready(function () {
	$('.postalCode').keyup(function () {
		if (this.value.length == this.maxLength) {
			$(this).next('.postalCode').focus();
		}
	});
});

Source: Stack Overflow
Working example: jsFiddle