Loading

Referring to the article "Best practices for speeding up your website" from YUI, adding "Expires Header" to static files can improve the load time of the web site. After searching around for answer on how to add expires header to my static files (e.g JPG, CSS, JS and etc), I found the solution below is the easiest to implement.

Add the configuration shown below in the in web.config file. Below is the sample configuration setup that cache the static files for 14 days before expired.

Add Expires header in ASP.NET using <clientCache> in web.config.


<system.webServer>
  <staticContent>
    <clientCache cacheControlMaxAge="14.00:00:00" cacheControlMode="UseMaxAge"/>
  </staticContent>
</system.webServer>

This implementation is confirmed with Firebug as shown in the snapshot taken below.



This will only work with IIS7.
I haven't test it my self, but I found some feedback from the other users.

Category: asp.netiis7

Windows 7 has provided a cool feature with ability to preview taskbar thumbnails whenever the mouse is hovered on the program icon. However, you may notice that it does have some latency to display the preview after mouse over the icon. To speed up the thumbnails preview, you can change the delay time with simple steps.

The delay time can be change via registry key. Please follow below steps to change it:

1. Go to Start -> Run, then type regedit.

2. Navigate to HKEY_CURRENT_USER\Control Panel\Mouse.
mousehovertimereg

3. On the right panel, look for MouseHoverTime and double click on it. Change the value to 0 (in millisecond) then click OK button to save the changes.
mousehovertimevalue

4. Close the registry editor and restart your computer in order to take the effect of the changes.

Once you have completed above steps, you can verify the delay time taken to display the thumbnail preview if it is faster than the previous.

Category: windows7

One annoying thing I noticed was that Visual Studio solutions were never showing up in the MRU list for Visual Studio. In fact, nothing was. It took about 5 seconds before I realized “duh… solutions aren’t associated with Visual Studio”. They’re actually associated with a stub called “Visual Studio Version Selector” which looks inside the .sln file and launches the appropriate version of Visual Studio if it is installed on your machine.

Personally, one version of Visual Studio is big enough for me so I always run the latest (currently Visual Studio 2008). I don’t need this version selector. Right Click –> Open With just screwed up the icons and didn’t help the MRU list problem but there was a very simply registry fix to make .sln files associate with Visual Studio 2008.

Windows Registry Editor Version 5.00 
[HKEY_CLASSES_ROOT\VisualStudio.Launcher.sln\Shell\Open\Command]
@="\"C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe\" \"%1\""
 

Put the above in a .reg file or go into regedit.exe and do it by hand. If you need more instructions then the hack probably isn’t for you. Note that this will eliminate the ability to double click a .sln file and have it open in the version of Visual Studio that created it. But who really does that anyway.

Category: windows7
Have you tried EnableViewState="False" and you still get the __VIEWSTATE hidden filed added?
If you want to use viewstate, then it's ok, but if I am not gonna use it, I don't want any information on my page that I don't need and that will only slow down the page load.

You can remove that hidden filed from the HTML with the code below.

            System.IO.StringWriter stringWriter = new System.IO.StringWriter();
            HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
            base.Render(htmlWriter);
            string html = stringWriter.ToString();
            int startPoint = html.IndexOf("<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\"");
            if (startPoint >= 0)
            {
                int endPoint = html.IndexOf("/>", startPoint) + 2;
                string viewstateInput = html.Substring(startPoint, endPoint - startPoint);
                html = html.Remove(startPoint, endPoint - startPoint);
                int formEndStart = html.IndexOf("</form>") - 1;
            }
            writer.Write(html);

You can put it MasterPage's Render method, but maybe the best place would be BasePage's Render method.
Create a BasePage class that inherits MasterPage (if you're using master pages) and add Render method like this:

public partial class BasePages : System.Web.UI.MasterPage
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
// Add code from above
}
}

After that, in your Master page, inherit the BasePage like so:

public partial class MyMasterPage : MyNamespace.BasePages
{
// Some code
}

And you're done.
__VIEWSTATE hidden filed will be removed.

Note that if the hidden field attributes are in some other order or upper or lower case, this code will not work since it is looking for the exact string and it is case sensitive so it needs a little bit of tweaking to get the best results.
Category: asp.net

So anybody who has Office 2007, will notice an extremely annoying new option on the context (right click) menu of everything… called “Groove Folder Synchronization” with some atrocious green icon next to it.

In order to remove the Groove Folder Synchronization from the context (right click) menu, you’ll need to edit the registry…

1. Press start.
2. Choose Run… (If you’re on Vista skip this step.)
3. Type “regedit” without the “quote” marks. (For Vista users, just type it in the “Start Search” bar.)
4. Press Enter
5. This will open up the Registry Editor, you’ll need to navigate to the following registry keys, and delete them. NOTE: These will all be FOLDERS that you will be deleting from the registry.

HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\XXX Groove GFS Context Menu Handler XXX

HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\XXX Groove GFS Context Menu Handler XXX

HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\XXX Groove GFS Context Menu Handler XXX

HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\XXX Groove GFS Context Menu Handler XXX

HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\XXX Groove GFS Context Menu Handler XXX

Find those folders and right click them and DELETE them from the registry. This will have NO adverse effects on your system, it will only remove the context menu that is so gaudy.

Have you just installed Windows 7 or Windows Server 2008 R2 and when you tried to setup your asp.net/mssql website you got following error: "Login failed for user 'IIS APPPOOL\Classic .NET AppPool'"?

It seems that new IIS version 7.5 runs its Classic .NET AppPool process with a different identity, and from there we get error "Login failed for user 'IIS APPPOOL\Classic .NET AppPool'".


Solution


  • go into Internet Information Services (IIS) Manager
  • expand node with your computer name on left side and select "Application Pools"
  • now in the window on the right side, right click "Classic .NET AppPool" and select "Advanced Settings..."


  • find "Identity" property and change its value to "LocalSystem"

When you get the following error “The tools version “4.0? is unrecognized” or for any other version, in Visual Studio 2008, apply the following fix.
Make sure these keys are present in the registry. If not present, add it.
This should resolve this issue.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\3.5] 
"DefaultToolsVersion"="2.0"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0] "MSBuildToolsPath"="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5] "MSBuildToolsPath"="C:\WINDOWS\Microsoft.NET\Framework\v3.5\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0] "MSBuildToolsPath"="C:\WINDOWS\Microsoft.NET\Framework\v4.0.20506\"
If you get Provider error '80004005' - Unspecified error after http://notepad.softwarevalley.net/view/13/microsoftodbc-microsoft-access-driver-the-microsoft-jet-data.aspx, you should try setting ConnectionTimeout for you Connection object to 20, for example, like this:

conn.ConnectionTimeout = 20
If you are using Classic ASP, you have probably seen this error before:
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.

To fix this problem, you need to set full control on c:\windows\temp for the IUSR account like this:

1. Open c:\windows and locate temp folder.
2. Right click on the temp folder and choose Properties
3. Click on the Security tab, then on Edit, Add, Advanced and finally Find Now
4. On the Search results find IUSR and Click OK two times and in Group and user names select UISR and click on Full control and then Apply, OK and OK once more
5. After that, refresh the application and error from above should be gone.

In Windows, whenever we right-click on Desktop or Explorer, we get "New" menu which contains shortcuts for various known file types. We can easily create new files using this handy "New" menu.



Sometimes we may want to remove a few unwanted items from "New" menu or we may want to add a few necessary items to "New" menu which are not present. So in this tutorial, I'll tell you how can you add / remove items to / from "New" menu:

A. To Add an Item in "New" menu:

1. Open regedit and expand "HKEY_CLASSES_ROOT" key.

2. Now look for the file type which you want to add in "New" menu, e.g. for adding MP3 file type look for .MP3 key.

3. Right-click on it and select "New -> Key" and give it name "ShellNew".

4. In right-side pane, right-click and select "New -> String Value". Give it name "NullFile" and press Enter.

5. Thats it. You'll immediately get the file type entry in "New" menu.

B. To Remove an Item from "New" menu:

1. Open regedit and expand "HKEY_CLASSES_ROOT" key.

2. Now look for the file type which you want to remove from "New" menu, e.g. for removing MP3 file type look for .MP3 key.

3. Expand it and delete the "ShellNew" key.

4. Thats it. The file type will be removed from "New" menu.
Category: windowsvista
Page 1 of 2 Previous »