posted on April 23, 2008

CustomError可以设置绝对路径

偶然发现web.config内自定义错误信息页面
  <customErrors mode="RemoteOnly"     defaultRedirect="503.aspx">
   <error statusCode="404" redirect="404.aspx"/>
  </customErrors>

可以设置成
  <customErrors mode="RemoteOnly"     defaultRedirect="503.aspx">
   <error statusCode="404" redirect="http://www.aspxboy.com/404.aspx"/>
  </customErrors>
这样的绝对路径.
看了一下 CustomErrorsSection 中的代码

internal string GetRedirectString(int code)
{
    
string absoluteRedirect = null;
    
if (this.Errors != null)
    
{
        CustomError error 
= this.Errors[code.ToString(CultureInfo.InvariantCulture)];
        
if (error != null)
        
{
            absoluteRedirect 
= GetAbsoluteRedirect(error.Redirect, this.basepath);
        }

    }

    
if (absoluteRedirect == null)
    
{
        absoluteRedirect 
= this.DefaultAbsolutePath;
    }

    
return absoluteRedirect;
}

 

 

发现事实如此.
期间有个小笑话,我试验的时候顺手输入了个http://x x.com/404.aspx (两个xx中没空格)这样到一个页面跳入了一个xx站点,吓我一大跳. ,工位附近有MM,不知道有否影响本人正值地形象哦

posted on April 20, 2008

使用AzMan找不到Microsoft.Interop.Security.AzRoles的解决方法

在c:/Windows/system32下找到azRoles.dll

如果没有Xp/2003请安装http://www.microsoft.com/downloads/details.aspx?FamilyID=e487f885-f0c7-436a-a392-25793a25bad7&DisplayLang=en.

Win2000请安装http://www.microsoft.com/downloads/details.aspx?FamilyID=7edde11f-bcea-4773-a292-84525f23baf7&DisplayLang=en.

Vs2003/Vs2005/Vs2008命令行,或者Cmd命令行进入.net安装目录

敲入:

d:\Program Files\Microsoft Visual Studio 9.0\VC>tlbimp azroles.dll /out:Microsof

t.Interop.Security.AzRoles.dll /namespace:Microsoft.Interop.Security.AzRoles


成功提示:


Microsoft (R) .NET Framework Type Library to Assembly Converter 3.5.21022.8

Copyright (C) Microsoft Corporation.  All rights reserved.


Type library imported to d:\Program Files\Microsoft Visual Studio 9.0\VC\Microso

ft.Interop.Security.AzRoles.dll




引用这个文件就OK了。


posted on April 3, 2008

MS Ajax 客户端生命周期

The flowing reference  is an excellent post !!!

http://aspnetresources.com/downloads/MS%20Ajax%20Client%20Life-Cycle%20Events.pdf