玄铁剑

成功的途径:抄,创造,研究,发明...
posts - 128, comments - 42, trackbacks - 0, articles - 174

重載FrameworkInitialize實現多國語言

Posted on 2008-03-12 11:23 玄铁剑 阅读(370) 评论(0)  编辑 收藏 引用 所属分类: asp.net

    配合资源文件,在Master中动态变换语言:
    //MasterPage
    protected override void FrameworkInitialize()
    {
        //Profile.Culture==>'en-us' and so on..
        System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(Profile.Culture);
        System.Threading.Thread.CurrentThread.CurrentCulture = ci;
        System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
        base.FrameworkInitialize();
    }

只有注册用户登录后才能发表评论。