If you want to set up proper 301 redirect for IIS website's root without affecting child virtual directories, save code below as "Default.aspx" and set default.aspx as first default document in IIS properties.

Any requests to root website will be redirected to URL you specify in "Location" header.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","
http://www.pallan.org");
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    </div>
    </form>
</body>
</html>

New Ajax Toolkit version released

6 Jun 2009 In: Development, ASP .NET, C#

New AjaxControlToolkit 3.0.30512 version released on May 12, 2009.

There are not too many changes from last release – bug fixes & 3 new controls – HTML Editor, ComboBox, ColorPicker.

More information about the toolkit and samples - http://www.asp.net/ajax/AjaxControlToolkit/Samples/

I had no troubles intalling BlogEngine 1.5 on IIS 6, but then I needed to install it on IIS 7 and was getting 500 error when trying to access it.

2 steps to solve this issue:

  1. In web.config file, remove system.webServer node
  2. Change application pool BlogEngine is running under to Classic .NET AppPool
    1. You should be able to connect to BlogEngine without problem now

If you want to use IIS 7 application pool and not Classic .NET AppPool

  1. Run this command %systemroot%\system32\inetsrv\APPCMD.EXE migrate config "WebSiteName/VirtualDirectoryName"
    1. WebSiteName = name of the website you've installed blog under
    2. If you used Virtual Directory, specify WebSiteName and VirtualDirectoryName, otherwise specify web site name only
  2. Change application pool from Classic .NET AppPool to IIS7 one

Fixing orphaned users in MS SQL

13 May 2009 In: Development, SQL

When restoring database on different MS SQL server, DB connections will be rejected unless 'orphaned' user is fixed. This applies even if the same username + password exists on target MS SQL Server.

You need to have appropriate permissions (DB admin) to be able to fix the 'orphaned' user.

EXEC sp_change_users_login 'Report' will show list of orphaned users

EXEC sp_change_users_login 'Auto_Fix', 'username' will fix orphaned user in case when same username and password exists on target server

EXEC sp_change_users_login 'Auto_Fix', 'username', 'login', 'password' will fix orphaned user and create new login on target server.