ASP. NET 2.0 product design changes between beta 1 and beta 2 (a new message from Asp.net Forum)

Source: Internet
Author: User
Today the Web Platform and Tools team is proud to announce two product design changes made directly in response and in conjunction with community feedback. the changes, detailed below are focused around two key areas. first, in September, we announced changes to the special private ASP. NET 2.0 directory naming. based on feedback, we are revising these names. second, we are making changes to the compilation model in order to enable ASP. net 1.x like behavior where. aspx file will now by default remain separate from the code-behind binary when pre-compiled (and can optionally be fully compiled into the binary ). we think these changes will address significant areas of customer concern, further simplify upgrading applications between ASP.. Net 1.x and 2.0, and we are excited that they will be begin shipping in the next Community Technology preview, scheduled for November. below, please find detailed information about each of these product changes.

Any questions shocould be addressed to this thread...

An easier on the eyes version of this announcement can be found:

Http://msdn.microsoft.com/asp.net/whidbey/beta2update.aspx

ASP. NET 2.0 directory naming changes

Summary
Last month, the Web Platform and Tools team announced a change in the special directory naming of ASP. NET 2.0. in discussing this change with MERs and community, we have Ed a strong response that prompted us to reconsider the proposed Syntax of application_xxx. after reviewing the feedback, re-thinking our goals, and looking at all possible options and feedback, we have decided to revise the changes in order to create a simpler and more usable syntax while also improving compatibility with existing ASP. net 1.x applications.

background
Asp. net uses a number of special directories in an application root in order to maintain Application Contents and data. in previous versions, only the bin directory was used. ASP. NET 2.0 introduces seven additional protected directories that may or may not exist in the application directory structure. none of these directories are automatically created by ASP. NET 2.0 or Visual Studio 2005, nor are the directories necessarily required to exist. each directory needs to be created either manually by the application developer, or on-demand through Visual Studio 2005 when a feature that requires it is enabled. internal estimates predict that only 1-3 additional directories will be present in an average ASP. NET application.

Post Alpha and beta1 releases, we have received a lot of feedback regarding conflicts between ASP. net special directories and identically named application directories used by our MERs. to avoid these issues, Asp. NET 2.0 uses a special naming convention for special directories to minimize chances of collisions with customer folders. this syntax also improves our ability to introduce additional special directories in Ure ure releases and helps to conceptually separate and group the directories used by the framework.

The original syntax, announced in September, received strong feedback from the user community primarily due to two issues: long directory names, and change of the legacy bin directory to the new name of application_assemblies. in these final changes to the syntax, our goal is to mitigate these problems and introduce a workable directory naming solution for the Beta 2 and RTM timeframe.

Description of changes
This change focuses on simplifying the special directory syntax, and retaining backwards compatibility with the applications and tools written for previous versions of ASP. NET. These changes to special directory names are as follows:

1. ASP. NET 2.0 will now use "app _" prefix for ASP. NET special Directories
2. ASP. NET 2.0 will continue to use the bin directory for application assemblies

The total set of special directories in the framework thus becomes:

/Bin
(Formerly application_assemblies) stays the same/bin
/Code
(Formerly application_code) becomes/app_code
/Resources
(Formerly application_globalresources) becomes/app_globalresources
/Localresources
(Formerly application_localresources) becomes/app_localresources
/Webreferences
(Formerly application_webreferences) becomes/app_webreferences
/Data
(Formerly application_data) becomes/app_data
/Browsers
(Formerly application_browsers) becomes/app_browsers
/Themes
(Formerly application_themes) becomes/app_themes

The content in all of the above directories other then app_themes will not be accessible via HTTP requests to the server. the request blocking will be carried out in the aspnet_filter.dll ISAPI filter installed with ASP. NET 2.0 Beta 2.

Alternate solutions considered
In selecting this solution, we considered a number of other options including using a single root directory for framework content, making the directory naming retriable, and using varous other syntax elements to distinguish the framework directories.

The single root approach was rejected because it did not enable us to support directories located in arbitrary locations in the application tree, such as the localresources directory.

The ISAPI filter used by ASP. net to protect the content in special directories form being downloadable over HTTP is not able to read configuration (otherwise the performance of all requests for ASP. net and non-ASP.NET content will be significantly impacted), and is limited to a single instance per machine. because of this limitation, introducing retriable syntax wowould require registry-based configuration, which breaks xcopy deployment of applications and presents an administrative problem, and particle in hosted scenarios.

In defining the naming syntax of the special directories, we found that file system supported characters other then the "_" such as "$ ,#,., "Had incompatibility conflicts with other internal or third party products. we feel that the current syntax is an acceptable compromise given the issues it was designed to solve, and presents the least risk of breaking existing tools and applications.

Questions shoshould be addressed to this thread.

ASP. NET 2.0 compilation model changes

Summary
In response to significant customer feedback, the Web Platform and Tools team has made an important change to the compilation model for ASP. NET 2.0. this change is a breaking change between beta1 and beta2 and will require you to make small changes to any application built using ASP. NET 2.0 Beta 1, Visual Studio 2005 Beta 1 and/or visual web developer 2005 express edition.

these changes affect the page directives and class derivation models. the goal is to improve the Code-behind and code-separation experience and enable the partial class paradigm to be used to improve the Code-behind experience while continuing to maintain a syntax and functionality that is very similar to ASP. net 1. x. as a result, it makes upgrading of v1.x projects even easier and further reduces new ASP. NET 2.0 specific concepts. opening a v1.x project in Visual Studio 2005 or visual web developer 2005 express edition will upgrade the project to ASP. NET 2.0.

In short, this change enables developers to continue to pre-compile ASP. net pages for significant performance gains while still being able to maintain. aspx markup content separate from the binary. this is the behavior developers have experienced today and is now available by default as a result of this change. you will also continue to optionally have the option to fully compile both. aspx markup and code into binary during pre-compilation. the default option in ASP. NET 2.0 now maintains. aspx markup separate from the code, which is compiled into a binary.

Details
The new class-derivation model enables the page to define controls without the need to have protected members created in an inherited separation file, or have explicit event definition. this removes a level of brittleness that the previous Code-behind model caused because the tool was required to keep the markup declarations and code-behind file in sync. with the new partial class based implementation, this tool based sync is no longer necessary, which makes it easier to separate the work on. aspx markup file and a code-behind file. the base class can be defined in the Code file and leverages partial classes for clean wire-up.

Webform1.aspx: <% @ page codefile = "webform1.aspx. cs" inherits = "webform1" %>
Webform1.aspx. CS: public partial class webform1: system. Web. UI. Page {}

1. Page directives change
The codebehind, compilewith changes to codefile and the classname changes to inherits. The Whidbey ASP. Net runtime still supports codebehind so v1.x Web applications can be moved unchanged to whidbey.

Codebehind and compilewith changes to codefile
Classname changes to inherits

2. Partial class change
The partial class in the code-behind file. the inherits class defines a base class. this change under the hood infers the same semantics for page directives (inherits) as in v1.x. the class is required to derive from page or usercontrol for user controls or masterpage for master pages or Child class of one of these classes.

3. Events
Change events to protected or public
VB sample: protected sub button#click (byval sender as object, byval e as system. eventargs)
C # sample: protected void button#click (Object sender, eventargs E)

Upgrading from v1.x to beta2

Before
Webform1.aspx: <% @ page codebehind = "webform1.aspx. cs" inherits = "webform1" %>
Webform1.aspx. CS: public class webform1: system. Web. UI. Page {}

After
Webform1.aspx: <% @ page codefile = "webform1.aspx. cs" inherits = "webform1" %>
Webform1.aspx. CS: public partial class webform1: system. Web. UI. Page {}

When codebehind is changed to codefile it is recommended that the application DLL that was previusly compiled by Vs, (which between des all pages in the application under bin) shocould also be deleted.

Migrating from Beta 1 to Beta 2

Before
Webform1.aspx: <% @ page compilewith = "webform1.aspx. cs" classname = "webform1" %>
Webform1.aspx. CS: public partial class webform1 {}// note there is no parent class

After
Webform1.aspx: <% @ page codefile = "webform1.aspx. cs" inherits = "webform1" %>
Webform1.aspx. CS: public partial class webform1: system. Web. UI. Page {}

VB sample: partial class default_aspx inherits system. Web. UI. Page

You will also be able to continue to inherit from any base class to build pages, master pages or custom controls. for. ascx files use system. web. UI. usercontrol as the parent class. for. master use system. web. UI. masterpage. only pages using "code behind/separation" are affected. all pages using "single page" mode do not need any change. it is recommended that the application DLL that was previusly compiled by vs (which has des all pages in the application under bin) shocould be deleted.

the classname to inherits change is required, note that classname is still a valid page directive which can be used to define the page class name as in v1.x. the Code-separation model creates 2 classes, even though the code-separation file is defined as a partial class. this model allows the v1.x compilation scenario for a code-separation file assembly and a dynamically compiled page-gen class. page and code-behind are no longer in same class, hence code that cross references each other between PAGE and code file might be broken e.g. A page can't have databinding syntax using private property/method in code file any more; code file can't use private class defined in page script block any more, etc.
Source: http://blog.aspcool.com/polaris/archive/2005/01/28/1791.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.