日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

剖析ASP.NET AJAX的面向?qū)ο笏枷?2)_.Net教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

推薦:ASP.NET緩存:方法分析和實(shí)踐示例
盡早緩存;經(jīng)常緩存 您應(yīng)該在應(yīng)用程序的每一層都實(shí)現(xiàn)緩存。向數(shù)據(jù)層、業(yè)務(wù)邏輯層、UI 或輸出層添加緩存支持。內(nèi)存現(xiàn)在非常便宜 — 因此,通過以智能的方式在整個(gè)應(yīng)用程序中實(shí)現(xiàn)緩存,可以

2.訪問修飾

許多面向?qū)ο缶幊陶Z言都有訪問修飾的概念。允許你指定類或成員在某種范圍內(nèi)有效。例如可在外部執(zhí)行的程序、具有相同名字空間的內(nèi)部類或特指的代碼快內(nèi)的類等。在JavaScript中沒有訪問修飾,但在ASP.NET AJAX中約定以下劃線字符開頭"_"的被認(rèn)為是私有的,類的外部不能訪問。

3.繼承

繼承是一個(gè)類派生于另一個(gè)類的能力。派生類自動(dòng)繼承基類的所有字段、屬性、方法和事件。派生類可以增加新的成員或者重寫基類已存在的成員來改變成員的行為。

下面的腳本實(shí)例有兩個(gè)類Person和Employee,Employee從Person繼承而來,兩個(gè)類示范了私有字段的使用,它們都有公共屬性、方法。另外Employee類重寫了Person類的toString實(shí)現(xiàn),并調(diào)用了基類的功能。

Type.registerNamespace("Demo");

  Demo.Person = function(firstName, lastName, emailAddress) {

  this._firstName = firstName;

  this._lastName = lastName;

  this._emailAddress = emailAddress;

  }

  Demo.Person.prototype = {

  getFirstName: function() {

  return this._firstName;

  },

  getLastName: function() {

  return this._lastName;

  },

  getEmailAddress: function() {

  return this._emailAddress;

  },

  setEmailAddress: function(emailAddress) {

  this._emailAddress = emailAddress;

  },

  getName: function() {

  return this._firstName ' ' this._lastName;

  },

  dispose: function() {

  alert('bye ' this.getName());

  },

  sendMail: function() {

  var emailAddress = this.getEmailAddress();

  if (emailAddress.indexOf('@') < 0) {

  emailAddress = emailAddress '@example.com';

  }

  alert('Sending mail to ' emailAddress ' ...');

  },

  toString: function() {

  return this.getName() ' (' this.getEmailAddress() ')';

  }

  }

  Demo.Person.registerClass('Demo.Person', null, Sys.IDisposable);

  Demo.Employee = function(firstName, lastName, emailAddress, team, title) {

  Demo.Employee.initializeBase(this, [firstName, lastName, emailAddress]);

  this._team = team;

  this._title = title;

  }

  Demo.Employee.prototype = {

  getTeam: function() {

  return this._team;

  },

  setTeam: function(team) {

  this._team = team;

  },

  getTitle: function() {

  return this._title;

  },

  setTitle: function(title) {

  this._title = title;

  },

  toString: function() {

  return Demo.Employee.callBaseMethod(this, 'toString') '\r\n' this.getTitle() '\r\n' this.getTeam();

  }

  }

  Demo.Employee.registerClass('Demo.Employee', Demo.Person);

分享:Asp.Net中動(dòng)態(tài)頁面轉(zhuǎn)靜態(tài)頁面
關(guān)于在Asp.Net中動(dòng)態(tài)頁面轉(zhuǎn)靜態(tài)頁面的方法網(wǎng)上比較多。結(jié)合實(shí)際的需求,我在網(wǎng)上找了一些源代碼,并作修改�,F(xiàn)在把修改后的代碼以及說明寫一下。 一個(gè)是一個(gè)頁面轉(zhuǎn)換的類,該類通過靜態(tài)函數(shù)Ch

來源:模板無憂//所屬分類:.Net教程/更新時(shí)間:2008-08-22
相關(guān).Net教程