ASP.NET 从Beta1 升级到 Beta2 的新变化

类别:Asp 点击:0 评论:0 推荐:

ASP.NET 从Beta1 升级到 Beta2 的新变化

         In config.web “debugmode” has been renamed to “debug”.

         RegisterPostBackScript() has been removed from Control. You no longer need to call RegisterPostBackScript() if you are using GetPostBackEventReference(). Calls to RegisterPostBackScript() should be removed from code.

         Regex options have been modified to use an enumeration instead of string values. For cross-.net framework consistency, regular expressions options should be an enumeration type, rather than a string value. The enumeration is in System.Text.RegularExpressions.RegexOptions. The string constructor has been marked as deprecated. This constructor has been retained since the JScript compiler relies on it. The mapping of strings to enumerated types is as follows.

String RegexOptions Enum "" None c Compiled d Debug (emits console text in debug builds) i IgnoreCase m Multiline n ExplicitCapture r RightToLeft s Singleline x IgnorePatternWhitespace

The following examples show the differences between the old and new forms.

// use a case-insensitive regex (old form)

Regex r = new Regex("mypatt", "i")

// use a case-insensitive regex (new form)

Regex r = new Regex("mypatt", RegexOptions.IgnoreCase)

// use a compiled regex, case-insensitive regex (old form)

Regex r = new Regex("mypatt", "ic")

// use a compiled regex, case-insensitive regex (new form)

Regex r = new Regex("mypatt", RegexOptions.IgnoreCase|RegexOptions.Compiled)

         The ASP.NET persistence format was changed. The name of the property becomes the tag name, and the attributes that were on the (redundant) child tag move to the tag itself. For collections and templates the property name becomes the tag name.

         The IDesignerAccessor interface has been deleted; any design-time functionality a control offers should be implemented in the associated designer.

         The IParserAccessor interface is now privately implemented. Only the parser should have been calling AddParsedSubObject(). If you override AddParsedSubObject() in your control, the access level has changed to protected.

         The IAttributeAccessor interface is also privately implemented.

Old Code:

Control.GetAttribute("Attrib")     
Control.SetAttribute("Attrib", "Value")

New Code:

Control.Attributes["Attrib"] = Value

         Changes were made in the ASP.NET Control designer framework. All public methods and properties using IHTMLElement and other trident interfaces are no longer public. Control designers no longer implement IOleCommandTarget. The Web forms designer handles IOleCommandTarget internally. Designers return a collection of DesignerVerb objects. The behavior implementations DHTMLBehavior and IdentityBehavior cannot be accessed directly. Use the IHtmlControlDesignerBehavior and IUserControlDesignerBehavior interfaces to access them from your designer.

Old form New form TemplatedControlDesigner::CanTemplateEdit CanEnterTemplateMode TemplatedControlDesigner::TemplateMode InTemplateMode HtmlControlDesigner::HTMLElement DesignTimeElement UserControlDesigner::ViewLinkRootElement DesignTimeElementView

         System.Web.UI.Web controls.Design.WebControlToolboxItem has been moved to System.Web.UI.Design.WebControlToolboxItem. This only affects you if you have metadata on your common language runtime controls that derive from Control directly (rather than from WebControl).

         The BubbleEvent() and InvokeBubbleEvent() methods on Control have been renamed to OnBubbleEvent() and RaiseBubbleEvent(), respectively.

         The paging semantics of the DataGrid control have changed. In Beta1, DataGrid paging worked such that the user's PageIndexChanged event handler was responsible for calling DataBind(), and the DataGrid would automatically update the CurrentPageIndex property of the DataGrid. This did not make the requirement to implement an event handler intuitive. Therefore, in Beta2, the DataGrid will not change the CurrentPageIndex automatically. In your event handler, you must determine whether it is appropriate to allow a change in the current page, update the CurrentPageIndex property, and call DataBind(). DataGridPageChangedEventArgs no longer has an OldPageIndex property, since this is same as the CurrentPageIndex property on the control itself.  

Old Code:

private void DataGrid_PageIndexChanged(object sender, DataGridPageChangedEventArgs e) {
((DataGrid)sender).DataSource = {your data source};
((DataGrid)sender).DataBind();
}

New Code:

private void DataGrid_PageIndexChanged(object sender, DataGridPageChangedEventArgs e) {
((DataGrid)sender).DataSource = {your data source};
((DataGrid)sender).CurrentPageIndex = e.NewPageIndex;
((DataGrid)sender).DataBind();
}

 As a result of this change, you can now prevent changes in the page index simply by not doing anything in your event handler.

         The DataBindings property and HasDataBindings() method on Control have moved into IDataBindingsAccessor. These properties should not exist on the public interface of a Control, since they are intended for use by the designer only. They are now part of IdataBindingsAccessor, which is implemented privately on Control. HtmlControlDesigner now has a DataBindings public property which control designers can use as well.  

Old Code:

Control c;
DataBindinGCollection bindings = c.DataBindings;

New Code:

Control c;
DataBindinGCollection bindings = ((IDataBindingsAccessor)c).DataBindings;

With a control designer, this.DataBindings will return the data-binding collection of the control associated with the designer.

         A DataMember property was added to data-bound controls. This is an addition of new functionality, instead of a breaking change. The DataSource property for HtmlSelect, ListBox, DropDownList, CheckBoxList, RadioButtonList, Repeater, DataList and DataGrid has been changed to an object (see notes that follow), so as to allow both IEnumerable and DataSet instances to be used as a data source. All of these controls now have a string DataMember property that is used when the DataSource property is assigned a DataSet.

Rules for resolving the DataSource:

1)If the data source is a DataSet:

a)If the DataMember property is specified, use it to determine which DataTable within the DataSet is to be used.

b)If the DataMember property is not specified, use the DataTable with index 0.

2)If the data source is not a DataSet:

a)Use the DataSource directly. 

         The DataGrid no longer has a PageCount property. The presence of a PageCount property implies the presence of a DataSource instance at all times, but this is not the case. The only time a DataSource exists is within a call to DataBind(). It is useful only when you create a Pager item; in that case a PagedDataSource is passed in, from which the page count is available. 

Old Code:

dataGrid.DataSource = myDataSet.Tables["Table1"].DefaultView;

New Code:

dataGrid.DataSource = myDataSet;
dataGrid.DataMember = "Table1";

DataSource is now of type Object so as to support both IEnumerable and DataSet instances as data sources. This will eventually be changed back to IEnumerable, once DataSet implements it.

         The signature of IConfigSectionHandler has changed. Support for ConfigXmlInput has been replaced with support for System.Xml.XmlReader instead.

         State has been renamed to ViewState in the Control framework. The following have changed.

  Old form New form MaintainState EnableViewState State ViewState LoadState LoadViewState LoadStateRecursive LoadViewStateRecursive SaveState SaveViewState SaveStateRecursive SaveViewStateRecursive IStateManager::Mark -> TrackState Control::Mark -> TrackViewState ControlState enum: StateLoaded ViewStateLoaded TemplateParser Will start looking for EnableViewState on page directives FMaintainState FEnableViewState

StateBag, StateItem, and IStateManager have not changed.

         The ASP.NET persistence format of properties, collections, and templates has changed. The new format is easier to understand, more consistent, and supports a broader range of property types with our standard parsing and persisting classes. In particular:

1)       The current inner persistence format tags are no longer supported.

2)       The persistence syntax on the top level tag as it is currently done for style properties is still supported.

3)       The "inner tag" persistence of complex properties like HeaderStyle is still supported.

4)       The "inner tag" persistence of template properties as an inner XML element that matches the property name, with no namesepace prefix, is still supported. Control classes which support persistence of Template properties might not be marked InnerChildren(true). See item 6 below.

5)       The "inner tag" persistence of collection properties is still supported.

6)       Inner persistence is disabled for any control that implements the [InnerChildren(true)] attribute on the Control class. The default value for this attribute is false. When true, all nested tags will be treated as literal inner content and will not be parsed. This attribute introduces a limitation: controls that support inner children cannot also persist collection or template properties.

7)       A terse "inner tag" persistence for controls that have a single, default collection property is still supported. In order to support the terse format, the property must be marked as follows.

[PersistenceType(PersistenceMode.DefaultCollection)]

            public ListItemCollection Items { ... }

  

         In System.Web.UI.Web controls, the MaximumControl and MinimumControl properties have been cut from RangeValidator. RangeValidator now always uses the MinimumValue and MaximumValue properties. Use of controls or values complicated the control because two comparison inputs never needed to be used at the same time. It is common to use a Control and a Value together, but this can also be achieved using a CompareValidator.

         In the ASP.NET Configuration, web.config at the computer level was renamed computer.config. In Beta 1, all config files were named config.web. Early in Beta 2, all config files were renamed to web.config. This change renames just the web.config in the common language runtime bin directory to computer.config.

         Page.Navigate() will be removed. Instead of using Page.Navigate, page developers should revert back to using Response.Redirect() to redirect users to different pages.

         In the ASP.NET Configuration, <appsettings> and IConfigurationSectionHandler now return a NameValueCollection instead of a Hashtable / IDictionary. The IConfigurationSectionHandler interface has been changed to object Create(Object parent, ConfigurationContext confiGContext, XmlNode section);

Old Code:

IDictionary appsettings = (IDictionary)Context.GetConfig("appsettings");

Create(Object parent, IDictionary confiGContext, XmlNode section);

New Code:

NameValueCollection appsettings = (NameValueCollection)Context.GetConfig("appsettings");

Create(Object parent, ConfigurationContext confiGContext, XmlNode section);  

         System.Web.UI.Page.ClientTarget has changed from the enum type ClientTarget to a string. It is still a page directive, but it now maps to entries in the .config file that override browser sniffing if it is nonblank. The page directive should still work as before for "Uplevel" and "Downlevel" values, although they need to be changed if they were referred to in code. IsUplevel() has been removed. ClientTarget will change the results of BrowserCaps, so IsUplevel() should be replaced with a more specific check of browser caps.  

Old Code:

Page p = new Page;

p.ClientTarget=ClientTarget.Uplevel;

if (p.IsUplevel) >= 0)) {厎

New Code:

Page p = new Page;

p.ClientTarget= "Uplevel"; // Example of a browser caps check

if (p.Request.Browser.MSDomVersion.Major >= 4) {

         The System.Web.UI.Web controls.BaseValidator protected methods Convert(), Compare(), CanConvert(), and GetDateElementOrder() have been moved from BaseValidator to BaseCompareValidator. These types should not have been used.

         System.Web.HttpCachePolicy.SetEtagFromFileDependencies() has been renamed to SetETagFromFileDependencies() (capitalized 'T').

         The XSP registry settings key has been changed from HKLM\Software\Microsoft\XSP to HKLM\Software\Microsoft\ASP.NET.

         HttpCacheVary is deprecated, and has been renamed to HttpCacheVaryByHeaders. HttpCachePolicy.Vary is deprecated, and has been renamed VaryByHeaders.

         The unmanaged ASP.NET binaries have been renamed from xsp* to aspnet_*.

Old form New form xspisapi.dll aspnet_isapi.dll xsprc.dll aspnet_rc.dll xspstate.exe aspnet_state.exe xspwp.exe aspnet_wp.exe xspperf.dll aspnet_perf.dll xspperf.ini aspnet_perf.ini ctrnames.h aspnet_perf.h

This change will affect setup. It should not affect other code. It will affect tests using xsptool if they call

Ecbhost.Use "/", ".", "xspisapi.dll".

This can be changed to either

Ecbhost.Use "/", ".", "aspnet_isapi.dll"

or just

Ecbhost.Use "/", ".", ""

         In computer.config and web.config, the < security > section has been broken out into separate configuration sections.

Old Code:

< security > < authentication > ... < identity > ...

< authorization > ... < /security >

New Code:

< authentication > ... < identity > ... < authorization > ...

         The Config XML files (computer.config, web.config) use camel-casing for tag names. The following is a list of most tags that have been updated:

applicationEnableAuthentication

asyncOption

cpuMask

enable timeout

enableCookielessSessions

globalEnableAuthentication

idleTimeout

memoryLimit

requestAcks

requestLimit

requestQueueLimit

shutdownTimeout

sqlconnectionstring

sqlConnectionString

stateconnectionstring

stateConnectionString

userAgent

webGarden

         The BaseFile properties and AddBaseFile() methods have been removed from System.CodeDom.Compiler.TempFileCollection. These are no longer needed, since TempFileCollection no longer uses a .tmp base file.

         HtmlControls and Web controls now privately implement all methods on IPostBackDataHandler and IPostBackEventHandler. Note that, in general, these methods should not be called from outside of the ASP.NET framework.

Old Code:

myControl.LoadPostData(?

New Code:

((IPostBackDataHandler) myControl).LoadPostData(?

         ASP.NET error processing has been changed. Page.HandleError() has been replaced by the Page_Error event. Application.LastError() has been replaced by Server.GetLastError(). Use Server.GetLastError() to get the exception that was thrown (it is not passed to the function like Application.LastError() was in Page.HandleError()). Server.ClearError() has been added.

         The HttpUtility class has been modified with some renames as well as new functionality. Functions that accept/return strings previously had ToString/FromString suffixes; these have been removed.The functions that return byte[] now have a ToBytes suffix. When the encoding is missing, UTF8 is implied.

Old name New signature UrlDecodeFromString string UrlDecode(string str, Encoding e); UrlEncode byte[] UrlEncodeToBytes(string str); UrlEncodeToString string UrlEncode(string str, Encoding e); UrlEncodeToStringUnicode string UrlEncodeUnicode(string str); UrlEncodeUnicode byte[] UrlEncodeUnicodeToBytes(string str);

The following new methods implement new functionality.

         Encoding from byte[] (escaping) and decoding to byte[] (un-escaping):

string UrlEncode(byte[] bytes);

string UrlEncode(byte[] bytes, int offset, int count);

byte[] UrlEncodeToBytes(byte[] bytes);

byte[] UrlEncodeToBytes(byte[] bytes, int offset, int count);

byte[] UrlDecodeToBytes(string str);

byte[] UrlDecodeToBytes(string str, Encoding e);

byte[] UrlDecodeToBytes(byte[] bytes);

byte[] UrlDecodeToBytes(byte[] bytes, int offset, int count);

         Added for completeness:

byte[] UrlEncodeToBytes(string str, Encoding e);

string UrlDecode(byte[] bytes, Encoding e);

         The <processModel> memoryLimit attribute now applies to the percentage of physical memory instead of virtual memory. This was done to reduce customer confusion by making this match the semantics of the issue process model flag that has the same functionality and operates on physical memory. The default value has changed from 40% of virtual memory to 80% of physical memory. This should provide approximately the same metric.

         The configuration for the Impersonation config section is changing in ASP.NET to make it attribute-based.

Old Code:

<configuration>
<system.web>
<security>
<identity>
<impersonation enable="true" username="user" password="pw"/>
</identity>
</security>
</system.web>
</configuration>

New Code:

<configuration>
<system.web>
<identity impersonate="false" username="user" password="pw"/>
</system.web>
</configuration>

 

The user name and password are still optional. There are no semantic changes associated with this change.

         Cookie authentication has been renamed to Forms authentication to give it a better semantic cover for possible cookieless support in the future. The has the following impact:

The authentication mode tag value is now "Forms" instead of "Cookie"

Old name New name System.Web.Security.CookieAuthentication System.Web.Security.FormsAuthentication System.Web.Security.CookieAuthenticationEvent System.Web.Security.FormsAuthenticationEvent System.Web.Security.CookieAuthenticationEventHandler System.Web.Security.FormsAuthenticationEventHandler System.Web.Security.CookieAuthenticationModule System.Web.Security.FormsAuthenticationModule System.Web.Security.CookieAuthenticationTicket System.Web.Security.FormsAuthenticationTicket

Old Code:

<authentication mode="Cookie" />
<cookie ... />
// global.asax
CookieAuthentication_OnAuthenticate(Object, CookieAuthenticationEventArgs);

New Code:

<authentication mode="Forms" />
<cookie ... />
// global.asax
FormsAuthentication_OnAuthenticate(Object, FormsAuthenticationEventArgs);

         Passport authentication now uses the PUID for PassportIdentity.Name (User.Identity.Name). According to the Passport SDK, the unique identifier for the user should be the PUID rather than the MemberName (which has been obsoleted). This does not change the object model, but it does change authorization sections for Passport users. Instead of using a name to perform explicit authorization against Passport users, you will need to refer to the PUID (or build a group and use that for authorization purposes). Config sections that only denied anonymous users for Passport will not need to be altered. The PUID is the Passport user ID and is a concatenation of the memberidhigh and memberidlow values from the profile. The following section from the Passport SDK demonstrates how the string is constructed:

If oPassMgrObj.HasProfile Then

      dim PUID, sMemberIDHigh, sMemberIDLow

     ' get values, convert to hexadecimal, concat and pad

      sMemberIDHigh = Hexadecimal(oMgr.Profile("memberidhigh"))

      sMemberIDLow = Hexadecimal(oMgr.Profile("memberidlow"))

      PUID = String(8 - len(sMemberIDHigh), "0") & sMemberIDHigh

      PUID = PUID & String(8 - len(sMemberIDLow), "0") & sMemberIDLow

End If

         For a combination of performance reasons and to support data validation for viewstate, the decryptionkey attribute is being removed form the <cookie> section.There will be a new config section called computerkey that looks like:


<computerkey validationkey="autogenerate" decryptionkey="autogenerate" validation="[SHA1|MD5|3DES]"/>

This allows both forms auth and viewstate to share validation keys and allows forms auth to have different keys for encryption/data validation. The default for both is "autogenerate", which uses a computer specific key. The validation attribute refers to the hashing algorithm to use; the default is SHA1, which matches current behavior. The timeout value indicates the time after which the cookie expires (this was previously hard coded or only set programmatically; it is not a breaking change) and the protection attribute defaults to "All" (matching current behavior) and allowing configurable support for weakened levels of security for increased perf for scenarios where cookie authorization is not used for strong authentication, only for personalization.

Old Code:

<cookie name="name" ... decryptionkey="autogenerate" />

New Code:

<cookie name="name" loginurl="login.aspx" protection="[All|None|Encryption|Validation]" timeout="60" />
<computerkey validationkey="autogenerate" decryptionkey="autogenerate" validation="[SHA1|MD5|3DES]"/>

         SoapException now has properties for OtherElements, Detail, and Code that are used to indicate whether a server error or a client error occurred.

         XML Serialization and Web Servises changed from 1999 XSD to 2000 XSD.

         Support has been added for special or streaming objects in web services. The Buffering property has been added on the [WebMethod] attribute and IEnumerable can now be supported as a datatype.

         The Guid and Char data types in XML serialization are now supported and will be passed through with full fidelity.

         The Web Services ClientProtocol has been updated in the following ways.

         Split ClientProtocol into WebClientProtocol and HttpWebClientProtocol. The split maps to the same split with System.Net.WebRequest and System.Net.HttpWebRequest. SoapClientprotocol is now SoapHttpClientProtocol.

         Removed Username, Password, and Domain properties. Use the Credentials property.

         Removed ProxyName and ProxyPort properties. Use the Proxy property.

         Added ConnectionGroupName property.

         Added ServicePoint property.

         The Cookies property is now a CookieContainer of type CookieContainer.

         Removed Send method.

         Changed protected methods BeginSend() and EndSend().

         Added GetWebRequest(), GetWebResponse(), InitializeAsyncRequest(), and WriteAsyncRequest() protected virtual methods. These methods are intended to be overridden (although derived classes will typically call the base class) to add features of the derived class. For example, HttpWebClientProtocol overrides GetWebRequest() to set its additional HTTP-only properties on the request object.

public abstract class WebClientProtocol : Component {

            // Constructors

protected WebClientProtocol();

// Properties

public ICredentials Credentials { get; set; }

public string ConnectionGroupName { get; set; }

public bool PreAuthenticate { get; set; }

public string Url { get; set; }

public int Timeout { get; set; }

// Methods

protected IAsyncResult BeginSend(string requestUrl, object internalAsyncState, AsyncCallback outerCallback, object outerAsyncState, bool callWriteAsyncRequest);

protected virtual WebRequest GetWebRequest(string url);

protected virtual WebResponse GetWebResponse(WebRequest request);

protected virtual WebResponse GetWebResponse(WebRequest request, IAsyncResult result);

protected virtual void InitializeAsyncRequest(WebRequest request, object internalAsyncState);

protected virtual void WriteAsyncRequest(Stream requestStream, object internalAsyncState);

protected WebResponse EndSend(IAsyncResult asyncResult, ref object internalAsyncState);

protected static object GetFromCache(Type type);

protected static void AddToCache(Type type, object value);

}

public abstract class HttpWebClientProtocol : WebClientProtocol {

          // Constructors

      protected HttpWebClientProtocol();

      // Properties

      public bool AllowAutoRedirect { get; set; }

      public CookieContainer CookieContainer { get; set; }

      public bool EnableCookies { get; set; }

      public string UserAgent { get; set; }

      public IWebProxy Proxy { get; set; }

      public ServicePoint { get; }

      // Methods

}

public class SoapHttpClientProtocol : HttpWebClientProtocol {

// Constructors

public SoapHttpClientProtocol();

// Properties

// Methods

public void Discover();

protected object[] Invoke(string methodName, object[] parameters);

protected IAsyncResult BeginInvoke(string methodName, object[] parameters, AsyncCallback callback, object asyncState);

protected object[] EndInvoke(IAsyncResult asyncResult);

}

public abstract class HttpSimpleClientProtocol : HttpWebClientProtocol {

// Constructors

protected HttpSimpleClientProtocol();

// Properties

// Methods

protected object Invoke(string methodName, string requestUrl, object[] parameters);

protected IAsyncResult BeginInvoke(string methodName, string requestUrl, object[] parameters, AsyncCallback callback, object asyncState);

protected object EndInvoke(IAsyncResult asyncResult);

}

public class HttpPostClientProtocol : HttpSimpleClientProtocol {

// Constructors

public HttpPostClientProtocol();

// Properties

// Methods

}

public class HttpGetClientProtocol : HttpSimpleClientProtocol {

// Constructors

public HttpGetClientProtocol();

// Properties

// Methods

}

         WebServiceUtil has been split into two tools: disco.exe and wsdl.exe. This is to simplify the command line arguments for using these features.

         The SoapExtension class now has a method for chaining the stream that can be overridden by SoapExtension writers. This allows chaining of the stream from the highest priority extension to the least, but calling the message orders from the least priority to highest.

         The method bool MessageEnumerator.MoveNext(TimeSpan timeout) is now void.

Old Code:

if(enumerator.MoveNext(timeout)){

ProcessNextMessage();

}

else{ StopProcessing(); }

New Code:

try{ enumerator.MoveNext(timeout));

ProcessNextMessage();

catch(TimeoutException){

StopProcessing();

}

         HttpCachePolicy.SetEtagFromFileDependencies() has been renamed to SetETagFromFileDependencies().

         The System.Web.UI.Web controls.Column.SortField property has been renamed to SortExpression. This is because it typically contains order information besides the field name, and might potentially contain multiple fields as well.

         Changes to Web controls (DataGrid, Table) and related classes.

         Renamed Column to DataGridColumn.

         Renamed ColumnCollection to DataGridColumnCollection.

         Removed TableRowCollection.AddWithCells().

         Removed TableCellCollection.AddWithContents().

         Changes to control and property attributes.

         Renamed TemplateAttribute to TemplateContainerAttribute.

         Replaced LiteralContentAttribute with PersistChildrenAttribute.

         Renamed PersistenceTypeAttribute to PersistenceModeAttribute.

         Replaced PersistenceMode.Tag with PersistenceMode.Attribute.

         Replaced PersistenceMode.Inner with PersistenceMode.InnerProperty.

         Replaced PersistenceMode.InnerChild with PersistenceMode.InnerDefaultProperty.

         Renamed ParseChildrenAsPropertiesAttribute to ParseChildrenAttribute.

         Changed Design-time control and template parsing. Any control and template parsing should be done by calling ControlParser.ParseControl() and ControlParser.ParseTemplate(), instead of calling ParseDesignerModeControl() and ParseDesignerModeTemplate() directly.

         The second parameter to the older DesignTimeData.DataBindingHandler() methods has been removed.

Old Code:

ParseDesignerModeControl(string, eventhandler)
ParseDesignerModeTemplate(string, eventhandler)

New Code:

ControlParser.ParseControl(IDesignerHost, string)
ControlParser.ParseTemplates(IDesignerHost, string)

         Changes to the control designer class hierarchy.

         Merged UserControlDesigner and WebControlDesigner into a single class called ControlDesigner.

         HtmlControlDesigner now derives directly from ComponentDesigner.

         Removed the old ControlDesigner class.

         Renamed PageletDesigner to UserControlDesigner.

         Renamed IUserControlDesignerBehavior to IControlDesignerBehavior.


New Hierarchy:
ComponentDesigner
    HtmlControlDesigner
        ControlDesigner
            TemplatedControlDesigner
            ReadWriteControlDesigner
            UserControlDesigner

         The WebFormDesigner in Visual Studio.NET should now derive from ComponentDesigner directly.

         All designers that derived from WebControlDesigner should derive from ControlDesigner.

         All designers that support template editing should derive from TemplatedControlDesigner, because support has been added for both Control-based and WebControl-based controls that have template properties.

         Changes to ASP.NET Control Designers DesignTimeHTML and Control.

         Renamed GetDesignTimeHTML to GetDesignTimeHtml.

         Similar renames for other Design-time HTML methods and GetPersistInnerHTML.

         Corresponding changes in IControlDesignerBehavior.

         OnControlResize and RaiseResizeEvent do not take any parameters. This method should only be called when the resize takes place due to a user action.

         Changes to System.Web.UI.Design.WebControlPersister.

         Renamed to ControlPersister.

         Methods Removed:

PersistChildControls()

PersistCollectionProperty()

PersistComplexProperty()

PersistStringProperty()

PersistTemplateProperty()

PersistDataBindings()

PersistTagProperties()

         All methods that took a StringWriter now take a TextWriter instead.

         All methods that took in an IWeb formservices now take in an IDesignerHost reference instead.

         Changes to Control and related classes (ControlCollection, ITemplate, IStateManager, IDataBindingsAccessor, and DataboundLiteralControl).

         Removed AllowsChildren from Control. Override CreateControlCollection() in your control and return an instance of EmptyControlCollection.

         Renamed Control.StateBagIgnoresCase to ViewStateIgnoresCase.

         ControlCollection is now public, and does not have an overload which takes in a Boolean value indicating whether Add is allowed.

         ITemplate.Initialize() renamed to InstantiateIn().

         IStateManager.IsMarked changed to the property IsTrackingViewState.

         IStateManager.TrackState renamed to TrackViewState.

         IStateManager changes also caused the corresponding methods on Control and Style to be changed in the same way.

         Renamed DataboundLiteralControl to DataBoundLiteralControl.

         IDataBindingsAccessor.HasDataBindings() changed to a property with the same name.

         Changes to DataBinder.Eval.

         The expression is now processed in a case-insensitive manner.

         New non-quoted format for string indexes added (the old format still works, but the designer will not process them). For example,
  DataBinder.Eval(DataSet1, "Tables[Table1].DefaultView")

         Changes to [WebMethod] attribute to support common enums for declaring transactions provided by Microsoft.ComServices.

Old Code:

[WebMethod(TransactionMode=TransactionMode.Required)]

New Code:

[WebMethod(TransactionSupport=TransactionSupport.Required)]

WebMethods can only participate as the root object in a transaction so the only options you would then be able to use would be

[WebMethod(TransactionSupport=TransactionSupport.Required] [WebMethod(TransactionSupport=TransactionSupport.RequiresNew]

         Changed the name and type of WebMethodAttribute.TransactionSupport to TransactionOption. This is the last step in the process of consolidating three transaction-related enums (System.Web.Util.TransactionSupport in ASP.NET, System.Web.Services.TransactionMode in WebService, and Microsoft.ComServices.TransactionOption in ComServices) to a single enum (TransactionOption).

         Removed the public static method System.Web.Services.Protocols.ValueCollectionParameterReader.UTF8Decode(). This method does not form a complete suite of functionality in this place. Users should use encoding and decoding methods available on System.Text.Encoding or System.Web.HttpUtility.

         In ASP.NET, properties on TemplateParser and related classes have been removed.The following classes have also been removed.

System.Web.TraceEnable BaseParser PageParser WebHandlerParser TemplateControlParser TemplateParser UserControlParser

         Register attributes are now required on the register directive. Visual Studio.NET requires this, and pages that do not have it do not open in VS.

         The /extendedNaming option has been removed from wsdl.exe and xsd.exe. The concept of extended properties has been removed, so this has no meaning.

         The Make Assembly attribute required on the register directive.

Visual Studio.NET requires it, and pages that do not have it do not open in Visual Studio.NET.

         Removed /extendedNaming from wsdl.exe and xsd.exe.

The /extendedNaming option will be removed from wsdl.exe and xsd.exe. The concept of extended properties has been removed, so this has no meaning.

         WebMethodAttribute: changed name and type of property TransactionSupport to TransactionOption.

This is the last step in the process of consolidating three transaction-related enums (System.Web.Util.TransactionSupport in ASP.NET, System.Web.Services.TransactionMode in WebService, and Microsoft.ComServices.TransactionOption in ComServices) to a single enum.

         Removed public static method System.Web.Services.Protocols.ValueCollectionParameterReader::UTF8Decode.

This method does not form a complete suite of functionality in this place; applications should use encoding and decoding methods available on System.Text.Encoding and/or System.Web.HttpUtility. This method was only used as an internal helper for formatting.

         Properties on TemplateParser and related classes need to be internal.

The following classes are implementation details and are being made internal to the framework.    System.Web.TraceEnable *    A consequence of this is that System.Web.UI.Page.TraceEnabled will return a Boolean instead of a System.Web.TraceEnable type.

         Removed ReadChars, ReadBinHex and ReadBase64 from the XmlReader and changed to implement them only on the XmlTextReader.

These methods exist so that you can access the stream, so they are not necessary on the node.

         Changed System.Web.UI.WebControls.Style.AddAttributesToRender to be nonvirtual In System.Web.UI.WebControls.Style.

Currently:

public virtual void AddAttributesToRenderr(HtmlTextWriter writer);

and

public virtual void AddAttributesToRenderr(HtmlTextWriter writer, WebControl owner)

This does not affect Visual Studio.NET.The WebControl class calls this, so most controls (external implementations), should not be affected either, given that the original method is still going to exist with public access.

         Moved DataBindingCollectionConverter from System.Web.UI to System.Web.UI.Design.

         Moved System.Web.UI.DataBindingCollectionConverter to System.Web.UI.Design.DataBindingCollectionConverter.

This is a namespace change without requiring this to move across assemblies. This class is implemented in System.Web.Design.dll.However, this is used only by the HtmlControlDesigner which lives in the Frameworks tree as well.It should not impact any code in the Visual Studio.NET tree.

         Removed CookielessSession from Machine.config.

The CookielessSessionModule and the SessionStateModule depend on each other. The architecture allows for these two modules to be merged, so they should be removed to save start up and memory costs, as well as avoid configuration errors.

         Cookies: Default set path to "/".

By default, the path for cookies created in ASP.NET uses the directory path of the application. This is case-sensitive and not often used; for example, the current path used is "/" for session cookies.To provide less confusion for end users, cookies created will use path "/" and be available throughout the application.

         Removed XmlString class.

XmlString class is now obsolete. Please use the XmlConvert class instead.

         Changed import method of ServiceImporter. New overloaded method takes place of old method.

public ServiceDescriptionImportWarnings Import(CodeCompileUnit codeCompileUnit)           

public ServiceDescriptionImportWarnings Import(CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit, string urlAppSettingKey, string appSettingBaseUrl)

         Configuration file camel casing:

In order to make the ASP.NET configuration file more consistent, all configuration tags should use camel casing (camelCasing)

         ASP.NET should not require the use of statics in generated code.

ASP.NET no longer generates CodeDom trees containing static constructors. The generated code used to use static constructors, but many third party languages do not have support for declaring static constructors.

         System.Web.Services.Configuration.SoapExtensionType should be internal, not public.

System.Web.Services.Configuration.SoapExtensionType and an inner enum, PriorityGroup should be internal. It is only used internally in System.Web.Services.dll (in the Configuration and Protocols namespaces under System).

         Added a property, ContainsListCollection, to System.ComponentModel.IlistSource

The updated IListSource would be:

interface IListSource {

bool ContainsListCollection { get; }

IList GetList();

}

This change should not require code changes.Only DataSet and DataTable currently implement this interface.

         Removed System.Web.UI.Design.WebControlToolboxItem::get_TagPrefix and System.Web.UI.TagPrefixAttribute.

Remove TagPrefix property of WebControlToolboxItem. Remove the TagPrefixAttribute class. These are no longer used by the Visual Studio.NET designer.

         Removed WebServiceRedirectException and WebServiceTimeoutException.

WebServiceRedirectException and WebServiceTimeoutException are not needed. This same information, along with much more, can be caught using the WebException from NCL.

         WSDL.exe changed method name to capitalize the first letter.

         Changed SoapElementAttribute and the other Soap*Attribute classes to be EncodedXmlElement, and so on.

All attributes that are currently Soap*Attribute will not be called EncodedXmlAttribute, since they are XML that is encoded and SOAP can use either of the following.

[SoapElement]public string Name;

[EncodedXmlElement]public string Name;

         RegexCharClass is now internal.

This class was only public so that expressions in compiled assemblies could call CharInSet. An additional method is being added to RegexRunner for this purpose. This class was private in Beta 1.  

         Regex.GroupNameFromNumber returns "" instead of null.

When a group could not be found, Regex.GroupNameFromNumber returned null.It now returns String.Empty.The method signature is unchanged.

string str = Regex.GroupNameFromNumber(1);if( str != null ) ConsumeGroupName(str);  

string str = Regex.GroupNameFromNumber(1);if( str != String.Empty ) ConsumeGroupName(str);

This does not appear to be used outside of its implementation.

         Moved System.Management Instrumentation classes/custom attributes from System.Management to System.Management.Instrumentation.

This change will affect DefaultManagementProjectInstaller, EventProvision, Instrumentation, ManagementInstaller, ProvisionFunction, ProvisionType Attributes:InheritedPropertyAttribute, InstrumentedAttribute, ManagedDefaultValueAttribute, ManagedNameAttribute, ManagedTypeAttr.

         A number of classes within System.Data, primarily associated with DataViews and DataViewManager, were marked as obsolete and have been removed,

         Deleted System.Web.UI.WebControls.OptionalIntegerConverter.

This type converter was added to allow showing a blank string in the properties window instead of "-1".This actually causes more problems than it solves, so it抯 being removed.

         Removed Indexed PixelFormat enums.

PixelFormat enums removed: Format1bppIndexed, Format4bppIndexed, Format8bppIndexed, Indexed.

         ProcessThreadCollection and ProcessModuleCollection have been marked "read only."

         Removed set_Item from the collections.

The default constructor is protected. A constructor that takes an array of modules/threads has been added.

         Generated SoapHeader variable names now end with "Value".

When WSDL.exe generates a proxy with SOAP headers specified in the WSDL, the SoapHeaders variable names now end with "Value".

         [XmlElement(*)] functionality has been replaced with [XmlAnyElement].

When you want to indicate that the XmlElement can take any xml, you formerly used the [XmlElement(*)] syntax. This has been replaced by the [XmlAnyElement] attribute.

         Changed GetWebRequest(string url) to GetWebRequest(Uri uri).

On the client protocol, there is a protected method that creates the new Web request for making the Web service call:

protected virtual WebRequest GetWebRequest(string url)

changed to    

protected virtual WebRequest GetWebRequest(Uri uri.

         WebClientProtocol and MimeReturnReader methods have been removed.

The following methods have been removed:

protected virtual void InitializeAsyncRequest(WebRequest request),

object internalAsyncState) {    ?SPAN style="mso-spacerun: yes">      }          

protected virtual void WriteAsyncRequest(Stream requestStream).  

         CodeIdentifiers methods have been removed.

The following methods that are no longer used In System.Xml.Serialization have been removed:

public class CodeIdentifiers {..}        

public void Remove(string identifier) {..}         

public void RemoveReserved(string identifier) {..}

         Breaking Change: Web.config true/false and enumeration values are case-sensitive.

All values of XML attributes are now case-sensitive, including boolean [true/false] and all enumeration values.

         Added System.Web.UI.TagPrefixAttribute.

Added TagPrefixAttribute (assembly-level attribute) to map namespaces to tag prefixes.

         IWebFormServices has been removed; IWebFormsDocumentService was added with similar functionality.

         System.Web.UI.Design.IwebFormReferenceManagerhas changed.

The following method has been added: Type GetObjectType(string tagPrefix, string typeName).

         Replaced System.Web.UI.Design.IWebFormsBuilderService with IWebFormsBuilderUIService.

The interface is the same except that the System.Web.UI.Design.IWebFormsBuilderUIService method takes an additional parameter of type UrlBuilderOptions.

         TemplateParser.ParseDesignerModeControl and ParseDesignerModeTemplate have changed.

This functionality has been moved into a class called DesignTimeTemplateParser.The methods are now called ParseControl and ParseTemplate. The methods take a parameter of type DesignTimeParseData. You use this class to pass in the parse text.

         Template-editing changes have been made for ASP.NET control designers deriving from TemplatedControlDesigner.

TemplateEditingFrame functionality has been split into ITemplateEditingFrame and TemplateEditingVerb.

         The old JScript CodeDom provider in System.dll has been removed.

The class Microsoft.JScript.CodeDomProvider has been moved from System.dll to Microsoft.JScript.dll.

         System.Web.Caching.Cache.MaxItems is obsolete and has been removed.

This property is not implemented.

         Passport 1.4 is now required.

ASP.NET now supports Passport 1.4, which requires the 1.4 build of the Passport SDK. There are no breaking changes, but PassportIdentity now supports AuthUrl2, LogoTag2, and LoginUser, which directly call the IPassportManager2 methods.

         Unknown SOAP headers cannot be required.

         DataRowState.New and DataViewRowState.New to DataRowState.Added and DataViewRowState.Added have changed.

Due to a recent change in the VISUAL BASIC compiler, VISUAL BASIC users now have to [bracket] any enum values with the name "New". If these aren't [bracket]ed, you will get an error when code is compiled.

         NameValueSectionHandler.CreateStatic has been removed.

         SoapExtension has changed.

The change is a new abstract method on SoapExtension. It is a new overload for the GetInitializer method. There are now two:

     public abstract object GetInitializer (LogicalMethodInfo method, SoapExtensionAttribute attribute)

     public abstract object GetInitializer(Type serviceType).

         SoapService and SoapMethod have been removed.

To create and consume services with the same functionality, the SoapMethodAttribute class has been divided into two classes: SoapRpcMethod and SoapDocumentMethod. SoapRpcMethod takes all the usual SoapMethod properties, and a new one: Use.

         Deprecated Passport methods have been removed.

Some Passport methods that have been deprecated in the Passport SDK 1.4 release and that won't be supported in Passport SDK 2.0 have been removed.All methods are on System.Web.PassportIdentity, including LogoTag, AuthUrl, Commit, SetProfile, and the set accessor for this[string].  

         Various Reset methods on DataTable are now private.

The following methods on the DataTable are used by the designers and should be defined private void: ResetPrimaryKey, ResetConstraints, ResetColumns, ResetRelations, ResetTables.

本文地址:http://com.8s8s.com/it/it9359.htm