• λ我爱Aspx >> C#.Net >> 三层Web体系结构里的两种数据绑定模式
  • 三层Web体系结构里的两种数据绑定模式

  • :李万宝  Դ:天极开发  :2007-3-16 21:56:10  ؼ:web
  • 编辑顾客页面的代码类似如下:

    //页面的一些指令//与Form窗体有关的一些顾客属性//提交和取消按钮

    编辑用户信息的后台代码类似如下:

    public partial class EditCustomer { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack){ //Check if adding new customer or updating if (_isUpdateMode) LoadData(); } } protected void btnSubmit_Click(object sender, EventArgs e) { if (!Page.IsValid) return; SaveData(); //Go Back } private void LoadData() { Customer customer=new Customer(); customerID=_customerID; customer.Load(); //Binding #2 //Copy customer properties into control values } private void SaveData() { Customer customer=new Customer(); If (_isUpdateMode) { customer.ID=_customerID; customer.Load(); } //Binding #3 //Copy control values into customer properties customer.Save(); }}

    /imagelist/06/48/752ycgk1i77s.swf

    Ҷƪл˵?
  • һƪ在ASP.NET 2.0中建立站点导航层次
    һƪC++/CLI中有效使用非托管并列缓存