由ASP.NET2.0向ASP.NET3.5过渡实用备忘录

 

     ASP.NET不知不觉中已经更新到3.5版本了,相信有很多朋友会由2.0迁移到3.5,我就是其中之一.为了节省我们的宝贵开发时间,尽量压缩在迁移的过程中所消耗成本,此文将以维基百科形式不断更新, 有兴趣的朋友可以在留言中把自己在工作中遇到的这方面的问题写出来,我会整理到此篇文章中.我先来一条,请博友们以此形式留言.

 

     一、基本 

 

    资源本地化时初始化语言变更 

     2.0:

          重写OnPreInit方法或InitializeCulture方法,并将语言编码覆给UICulture,Culture即可将该页面初始化此种语言.  

1 protected   override   void  OnPreInit(EventArgs e)
2 ExpandedBlockStart.gifContractedBlock.gif {
3   this.Page.UICulture = this.Page.Culture = "ZH-CN";
4   base.OnPreInit(e);
5}

或者

ContractedBlock.gif ExpandedBlockStart.gif Code
1protected override void InitializeCulture()
2ExpandedBlockStart.gifContractedBlock.gif{
3   this.Page.UICulture = this.Page.Culture = "JA-JP";
4   base.InitializeCulture();
5}

     3.5:

          不再支持OnPreInit方法.

 

     属性定义

     2.0

ContractedBlock.gif ExpandedBlockStart.gif Code
1String _name;
2public String Name
3ExpandedBlockStart.gifContractedBlock.gif{
4ExpandedSubBlockStart.gifContractedSubBlock.gif    set{_name = value;}
5ExpandedSubBlockStart.gifContractedSubBlock.gif    get{return _name;}
6}

 

     3.0、3.5

ContractedBlock.gif ExpandedBlockStart.gif Code
1public String Name
2ExpandedBlockStart.gifContractedBlock.gif{
3    get;set;
4}

转载于:https://www.cnblogs.com/delphiren/archive/2008/07/31/1257108.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值