IIS Compression (gzip)
Enabling HTTP Compression for II7/IIS6
Enabling HTTP Compression IIS6
Nothing happens when you select View Source option in Internet Explorer.
This happend to me after upgrading from IE8 to IE9 – the View Source option just stopped working. Deleting Temporary Files via IE options menu did not help. The FIX - navigate to “C:\Users\[Your User Name]\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\” folder and remove all files/folders including index.dat file. Make sure you can see hidden files/folders when you do that. Also note the [Low] section of the path.
Need to auto tab to the next form field when the maximum number of entered characters is reached.
Assigned [maxlenght] attribute and [autotab] class to each field you want to auto tab. Add the following code to $(document).ready event:
$('.autotab').keydown(function(event) { //save previously entered value prior to keyup event $(this).attr('prevValue', $(this).val()); }); $('.autotab').keyup(function(event) { var newValue = $(this).val(); //see if the textbox had its value changed if ($(this).attr('prevValue') != newValue) { //see if the number of entered characters is equal or greater //than the allowable maxlength if (newValue.length >= $(this).attr('maxlength')) { //set focus on the next field with autotab class $(this).next('.autotab').focus(); } //save newly entered value for the next execution of this event $(this).attr('prevValue', newValue) } });
Hopefully, my comments in the above code is enough to understand how it works.
You receive “TruncationException: Trying to convert return value or output parameter of size XXX bytes to a T-SQL type with a smaller size limit of 8000 bytes” error while trying to execute CLR stored procedure in SQL Server 2008.
CLR stored procedure is trying to return via output parameter string that exceeds 8000 bytes. Declaring output parameter as nvarchar(MAX) is not enough to overcome 8000 bytes limit.
In order to return strings via CLR procedures that are more than 8000 bytes you need to apply a special attribute called SqlFacet(MaxSize) to the output parameter.
Example in VB.NET:
Public Shared Sub MySP(<SqlFacet(MaxSize:=-1)> ByRef ret As SqlString)
Example in C#:
public static SqlString MySP([param: SqlFacet(MaxSize=-1)] SqlString ret)
My.Settings.YourSettingName is a read only property for application scope configuration
By design you can’t modify application scope configuration settings, e.g. My.Settings.Setting1 is always read-only.
You can change the scope of the setting from Application to User, but then the setting will be stored in user.config instead of app.config
Another solution is to access application configuration file directly via System.Configuration.Configuration class. Here a small sample that updates LastDownloadDate configuration setting inside applicationSettings/APP.My.MySettings section:
Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Dim sec As ClientSettingsSection = config.GetSection("applicationSettings/APP.My.MySettings")
sec.Settings.Get("LastDownloadDate").Value.ValueXml.InnerXml = Now.ToString
sec.SectionInformation.ForceSave = True
config.Save(ConfigurationSaveMode.Modified)
You receive “Cannot get IIS pickup directory” error while trying to send email via System.Net.Mail namespace in ASP.NET.
User account under which the ASP.NET code is being executed doesn’t have access to the SMTP configuration path in IIS metabase.
The above steps will give your_domain\your_username Read & Enumerate permissions in IIS metabase on SMTPsvc branch.