ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: ASP.NET :: ASP.NET 2.0 ÐÂÌØÕ÷

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

ASP.NET
asp.netµÄ°²×°
ASP ºÍ ASP.NET Ö..
ASP.NET ½éÉÜ

ASP.NET 2.0 ÐÂÌØÕ÷


×÷Õß:w3schools ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-08-13 ä¯ÀÀ:2921 :: ::

ASP.NET 2.0 improves ASP.NET by adding several new features.
ASP.NET 2.0 ͨ¹ý¼ÓÈëÁ˶à¸öÐÂÌØÐÔÀ´¶ÔASP.NET½øÐÐÁ˼ÓÇ¿¡£


Improvements in ASP.NET 2.0
ÔÚASP.NET 2.0 ÖеĸĽø

ASP.NET 2.0 was designed to make web development easier and quicker.
ASP.NET 2.0 ¿ÉÈÃWEB¿ª·¢¸ü¼Ó¼òµ¥¸ü¼Ó¿ì½Ý¡£

Design goals for ASP.NET 2.0:
ASP.NET 2.0µÄÉè¼ÆÄ¿±ê£º

  • Increase productivity by removing 70% of the code
    ͨ¹ýÏ÷¼õ70%µÄ´úÂëÀ´¼Ó¿ì¿ª·¢
  • Use the same controls for all types of devices
    Õë¶ÔËùÓÐÀàÐ͵ÄÉ豸ʹÓÃÏàͬµÄ¿Ø¼þ
  • Provide a faster and better web server platform
    ÌṩÁËÒ»¸ö¸ü¿ì¸üºÃµÄWEB·þÎñƽ̨
  • Simplify compilation and installation
    ¼òµ¥µÄ±àÒëºÍ°²×°
  • Simplify the administration of web applications
    WEBÓ¦Óõļòµ¥¹ÜÀí

What's New in ASP.NET 2.0?
ASP.NET 2.0 ÐÂÌØÐÔ£¿

Some of the new features in ASP.NET 2.0 are:
ÔÚASP.NET2.0ÖÐÓÐһЩеÄÌØÐÔ£º

  • Master Pages, Themes, and Web Parts
    Ö÷Ò³£¬Ö÷Ì⣬ÒÔ¼°WEB²¿¼þ
  • Standard controls for navigation
    Õë¶Ôµ¼º½µÄ±ê×¼¿Ø¼þ
  • Standard controls for security
    Õë¶Ô°²È«µÄ±ê×¼¿Ø¼þ
  • Roles, personalization, and internationalization services
    ½ÇÉ«£¬¸öÐÔ»¯ÒÔ¼°¹ú¼Ê»¯·þÎñ
  • Improved and simplified data access controls
    ¼ÓÇ¿²¢¼ò»¯ÁËÊý¾Ý·ÃÎʿؼþ
  • Full support for XML standards like, XHTML, XML, and WSDL
    Íêȫ֧³ÖXML±ê×¼£¬±ÈÈçXHTML£¬XMLÒÔ¼°WSDL
  • Improved compilation and deployment (installation)
    ¼ÓÇ¿Á˱àÒëÒÔ¼°²¿Ê𣨰²×°£©
  • Improved site management
    ¼ÓÇ¿ÁËÕ¾µãµÄ¹ÜÀí
  • New and improved development tools
    һЩȫеÄÒÔ¼°¼ÓÇ¿Á˵Ŀª·¢¹¤¾ß

The new features are described below.
ÏÂÃæ½«ÃèÊöÐÂÌØÐÔ


Master Pages
Ö÷Ò³

ASP.NET didn't have a method for applying a consistent look and feel for a whole web site.
ASP.NET ÎÞ·¨ÔÚÍâ¹ÛÉÏÈÃÕû¸öWEBÕ¾µã±£³ÖÒ»Ö¡£

Master pages in ASP.NET 2.0 solves this problem.
ÔÚASP.NET 2.0 ÀïµÄÖ÷Ò³¾Í¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ

A master page is a template for other pages, with shared layout and functionality. The master page defines placeholders for content pages. The result page is a combination (merge) of the master page and the content page.
ͨ¹ý¹²Ïí²¼¾ÖÒÔ¼°¹¦Äܿ飬һ¸öÖ÷Ò³¿ÉÕë¶ÔÆäËûÒ³Ãæ³ÉΪһ¸öÄ£°å¡£Ö÷Ò³¿ÉÒÔΪÄÚÈÝÒ³¶¨Òåռλ·û¡£Ö÷Ò³ºÍÄÚÈÝÒ³½áºÏºó¾Í¿ÉÒÔ²úÉú½á¹ûÒ³¡£

Read more about master pages.[¸ü¶àÓйØÖ÷Ò³µÄÐÅÏ¢]


Themes
Ö÷Ìâ

Themes is another feature of ASP.NET 2.0. Themes, or skins, allow developers to create a customized look for web applications.
ÔÚASP.NET2.0Öл¹ÓиöÌØÐÔÊÇÖ÷Ì⣬Ö÷Ì⣬»òÊÇÆ¤·ô£¬ÔÊÐí¿ª·¢ÈËÔ±½¨Á¢×Ô¶¨ÒåµÄWEBÓ¦ÓóÌÐòÍâ¹Û¡£

Design goals for ASP.NET 2.0 themes:
Éè¼ÆASP.NET2.0Ö÷ÌâµÄÄ¿±êÊÇ£º

  • Make it simple to customize the appearance of a site
    ÈÃ×Ô¶¨ÒåÕ¾µãµÄÍâ¹ÛÈÝÒ×һЩ
  • Allow themes to be applied to controls, pages, and entire sites
    ÔÊÐíÈÃÖ÷ÌâÓ¦Óõ½¿Ø¼þ£¬Ò³ÃæÒÔ¼°Õû¸öÕ¾µãÉÏ
  • Allow all visual elements to be customized
    ÔÊÐí×Ô¶¨ÒåËùÓпÉÊÓÔªËØ

Web Parts
WEB²¿¼þ

ASP.NET 2.0 Web Parts can provide a consistent look for a site, while still allowing user customization of style and content.
ÔÚÔÊÐíÓû§×Ô¶¨ÒåÑùʽÒÔ¼°ÄÚÈݵÄǰÌáÏÂASP.NET WEB²¿¼þ¿ÉÒÔÌṩվµãÒ»ÖµÄÍâ¹Û¡£

New controls:
пؼþ£º

  • Zone controls - areas on a page where the content is consistent
    ÇøÓò¿Ø¼þ - ÔÚÒ³ÃæÉÏÄÇЩÄÚÈÝÒ»ÖµÄÇøÓò
  • Web part controls - content areas for each zone
    WEB²¿¼þ¿Ø¼þ - ÿ¸öÇøÓòµÄÄÚÈݲ¿·Ö

Navigation
µ¼º½

ASP.NET 2.0 has built-in navigation controls like
ÔÚASP.NET2.0ÖÐÓÐÁËÄÚÖõĵ¼º½¿Ø¼þ£¬Ïñ£º

  • Site Maps
    ÍøÕ¾µØÍ¼
  • Dynamic HTML menus
    ¶¯Ì¬HTML²Ëµ¥
  • Tree Views  
    Ê÷×´ä¯ÀÀ

Security
°²È«

Security is very important for protecting confidential and personal information.
ÔÚ±£»¤»úÃÜÒÔ¼°¸öÈËÐÅÏ¢Éϰ²È«ÊǷdz£ÖØÒªµÄ¡£

In ASP.NET 2.0 the following controls has been added:
ÔÚASP.NET2.0 ÖмÓÈëÁËÒÔÏÂÕâЩ¿Ø¼þ£º

  • A Login control, which provides login functionality
    µÇ½¿Ø¼þ£¬¿ÉÌṩµÇ½¹¦ÄÜ
  • A LoginStatus control, to control the login status
    µÇ½״̬¿Ø¼þ£¬¿ØÖƵǽµÄ״̬
  • A LoginName control to display the current user name
    µÇ½Ãû¿Ø¼þ£¬À´ÏÔʾµ±Ç°Óû§Ãû
  • A LoginView control, to provide different views depending on login status
    µÇ½ä¯ÀÀ¿Ø¼þ£¬¸ù¾ÝµÇ½״̬Ìṩ²»Í¬µÄÏÔÏÖÄÚÈÝ
  • A CreateUser wizard, to allow creation of user accounts
    ½¨Á¢Óû§Ïòµ¼£¬ÔÊÐí½¨Á¢Óû§ÕʺÅ
  • A PasswordRecovery control, to provide the "I forgot my password" functionality
    ÃÜÂëÕһؿؼþ£¬¿ÉÌṩ“Íü¼ÇÃÜÂ딵ŦÄÜ¡£

Roles and Personalization
½ÇÉ«ÒÔ¼°¸öÐÔ»¯

Internet communities are growing very popular.
»¥Á¬Íø½»Á÷ÈÕÇ÷Á÷ÐÐ

ASP.NET 2.0 has personalization features for storing user details. This provides an easy way to customize user (and user group) properties.
ASP.NET 2.0 ÓµÓиöÐÔ»¯ÌØÐÔ¿É´æ´¢Óû§µÄÏêϸ×ÊÔ´¡£Õâ¿ÉÒÔÌṩһÖÖ¼òµ¥µÄ·½·¨À´×Ô¶¨ÒåÓû§£¨ÒÔ¼°Óû§×飩µÄÊôÐÔ¡£


Internationalization
¹ú¼Ê»¯

Reaching people with different languages is important if you want to reach a larger audience.
Èç¹ûÄãÏëÒªÓ°Ïìµ½¸ü¶àµÄÈËȺ£¬Ê¹ÓöàÖÖÓïÑԾͷdz£ÖØÒª¡£

ASP.NET 2.0 has improved support for multiple languages.
ASP.NET 2.0 ¸Ä½øÁ˶ԶàÖÖÓïÑÔµÄÖ§³Ö


Data Access
Êý¾Ý·ÃÎÊ

Many web sites are data driven, using databases or XML files as data sources.
¶àÊýÍøÕ¾Í¨¹ýʹÓÃÊý¾Ý¿â»òÊÇXMLÎļþÀ´×öΪÊý¾ÝÇý¶¯¡£

With ASP.NET this involved code, and often the same code had to be used over and over in different web pages.
ʹÓÃASP.net ÕâÊǸöºÜÂé·³µÄ´úÂ룬¶øÇÒÏàͬµÄ´úÂë±ØÐëÔÚ²»Í¬µÄÒ³ÃæÀïÖØ¸´³öÏÖ¡£

A key goal of ASP.NET 2.0 was to ease the use of data sources.
ÔÚASP.NET 2.0ÖÐÓиö¹Ø¼üµÄÄ¿±ê¾ÍÊÇÒªÈÃÊý¾ÝÔ´µÄʹÓøü¼ÓÇáËÉ¡£

ASP.NET 2.0 has new data controls, removing much of the need for programming and in-depth knowledge of data connections.
asp.net 2.0ÓµÓÐеÄÊý¾Ý¿Ø¼þ¼¯£¬É¾³ýÁ˺ܶàÐèÒª±à³ÌÒÔ¼°ÉîÈëÁ˽âÊý¾ÝÁ¬½Ó֪ʶµÄÄÚÈÝ¡£


Mobility Support
Ö§³ÖÒÆ¶¯

The problem with Mobile devices is screen size and display capabilities.
ÒÆ¶¯É豸µÄÆÁÄ»³ß´çÒÔ¼°ÏÔʾÐÔÄÜÊǸöÎÊÌâ

In ASP.NET, the Microsoft Mobile Internet Toolkit (MMIT) provided this support.
ÔÚASP.NET ÖУ¬Î¢Èí»¥ÁªÍøÒƶ¯¹¤¾ßÏä(MMIT) ¶ÔÕâ·½ÃæÌṩÁËÖ§³Ö

In ASP.NET 2.0, MMIT is no longer needed because mobile support is built into all controls.
ÔÚASP.NET 2.0ÖУ¬MMIT²»ÔÙÐèÒªÒòΪÕâÐ©ÒÆ¶¯Ö§³ÖÒѾ­½¨Á¢µ½ËùÓпؼþÖÐÁË¡£


Images
ͼÏó

ASP.NET 2.0 has new controls for handling images:
ASP.NET 2.0 ÓÐÁË´¦ÀíͼÏóµÄпؼþ£º

  • The ImageMap control - image map support
    ͼÏóÈÈµã¿Ø¼þ - ¿ÉÒÔÖ¸³öͼÏóµÄÈȵãÓ³Éä
  • The DynamicImage control  - image support for different browsers
    ¶¯Ì¬Í¼Æª¿Ø¼þ - ¶ÔÖÖä¯ÀÀÆ÷É϶¼¿ÉÒÔÖ§³Ö

These controls are important for better image display on mobile devices, like hand-held computers and cell phones.
ÕâЩ¿Ø¼þ¶ÔÓÚÔÚÒÆ¶¯É豸ÉÏÏÔʾ¸üÓÅÖʵÄͼƬÆðµ½ÁËÖØÒªµÄ×÷Ó㬱ÈÈçÊÖÌáµçÄÔÒÔ¼°¸öÈ˵绰


Automatic Compilation
×Ô¶¯±àÒë

ASP.NET 2.0 provides automatic compilation. All files within a directory will be compiled on the first run, including support for WSDL, and XSD files.
ASP.NET 2.0 ÌṩÁË×Ô¶¯µÄ±àÒ룬ËùÓÐÔÚͬһĿ¼µÄÎļþ»áÔÚµÚÒ»´ÎÔËÐеÄʱºò½øÐбàÒ룬Õâ°üÀ¨¶ÔWSDLÒÔ¼°XSDÎļþµÄÖ§³Ö


Compiled Deployment (Installation) and Source Protection
±àÒëµÄ²¿Ê𣨰²×°£©ÒÔ¼°´úÂë±£»¤

ASP.NET 2.0 also provides pre-compilation. An entire web site can be pre-compiled. This provides an easy way to deploy (upload to a server) compiled applications, and because only compiled files are deployed, the source code is protected.
ASP.NET 2.0 »¹ÌṩÁËÔ¤ÏȱàÒ룬һ¸öÍêÕûµÄÕ¾µã¿ÉÒÔ½øÐÐÔ¤ÏȱàÒë¡£Õâ¾Í¸øÉÏ´«±àÒëºóµÄÓ¦ÓóÌÐòÌṩÁ˼òµ¥µÄ·½·¨£¬²¢ÇÒÒòΪÉÏ´«µÄÖ»ÊDZàÒëºóµÄÎļþ£¬ËùÒÔ´úÂëÊÇÊܱ£»¤µÄ¡£


Site Management
Õ¾µã¹ÜÀí

ASP.NET 2.0 has three new features for web site configuration and management:
ASP.NET 2.0ÓÐÕë¶ÔÍøÕ¾ÉèÖÃÒÔ¼°¹ÜÀíµÄÈý¸öÐÂÌØÐÔ£º

  • New local management console
    ȫеı¾µØ¹ÜÀí¿ØÖÆÌ¨
  • New programmable management functions (API)
    È«Ðµģ¬¿É±à³ÌµÄ¹ÜÀíº¯Êý£¨API£©
  • New web-based management tool
    ȫеĻùÓÚÍøÕ¾µÄ¹ÜÀí¹¤¾ß

Development Tools
¿ª·¢¹¤¾ß

With ASP.NET Visual Studio.NET was released with project and design features targeted at corporate developers.
¶¨Î»ÓÚÆóÒµ¼¶µÄ¿ª·¢Õß ASP.NET ¿ÉÊÓ»¯¹¤×÷ÊÒ¸úËæ×Ź¤³Ì¶ÔÍâÊÍ·ÅÁË¡£

With ASP.NET 2.0, Visual Studio 2005 was released.
°éËæ×ÅASP.NET2.0 ,VS2005ÒѾ­ÊÍ·Å

Key design features for Visual Studio 2005 include:
ÔÚVS2005Öм¸¸ö¹Ø¼üµÄÌØÐÔ°üÀ¨£º

  • Support for the features described above
    Ö§³ÖÒÔÉÏÃèÊö¹ýµÄËùÓÐÌØÐÔ
  • Upload files from anywhere (FTP, File System, Front Page....)
    ¿ÉÒÔÔÚÈκεط½ÉÏÔØÎļþ
  • No project files, allowing code to be manipulated outside Visual Studio
    ûÓй¤³ÌÎļþ£¬ÔÊÐíÔÚVSÍâÃæ²Ù×÷´úÂë
  • Integrated Web Site Administration Tool
    ÍêÕûµÄÍøÕ¾¹ÜÀí¹¤¾ß
  • No "build" step - ability to compile on first run
    ûÓÐ “½¨Á¢” ²½Öè - ¿ÉÒÔÔÚµÚÒ»´ÎÔËÐеÄʱºò½øÐбàÒë

Visual Web Developer is a new free ASP.NET 2.0 tool for non-corporate developers who don't have access to Visual Studio.NET.
Visual Web Developer ÊÇÕë¶ÔÄÇЩ·ÇÆóÒµÓ¦Óò¢ÇÒ²»ÐèÒª·ÃÎÊVisual Studio.NET¿ª·¢ÕßµÄÃâ·ÑÐÂÑ¡Ôñ

ÆÀÂÛ (0) All