Share via


ASP.NET Design-Time Breaking Changes


Short Description DesignTimeElement and DesignTimeElementView are being obsoleted and modified.
Affected APIs System.Design Severity Very Low Compat Switch Available No

Description

DesignTimeElement: In V1.x the getter returned the object that represents the element in the design-surface for the control. In most cases this was used to apply styles to the element, or to walk the IE DOM to perform actions such as add controls, iterate the script functions, etc. Users could cast the object to a number of the IHtmlElement interfaces and effectively walk the IE DOM and perform actions through the interface implementation.

DesignTimeElementView: The V1.x view-link design is no longer supported or provided in V2.0. It is therefore not even possible to recreate the potential object that was previously available. The old design has been superseded by region-based editing. It is anticipated that there are no to very little control designers using this property, as there are no real scenarios that required the property.


User Scenario See Description and Sample Code

Work Around

DesignTimeElement: In V2.0 a number of APIs have been added to the ControlDesigner to provide explicit functionality.

  1. WebFormsRootDesigner.AddControlToDocument is expanded to allow granularity of the addition of a control or child control in pages. This includes before and after selection, or referenceControl, or at the beginning or end of a document.
  2. WebFormsRootDesigner.RemoveControlFromDocument deletes a control from the document.
  3. WebformsRootDesigner..GetClientScriptsInDocument
  4. WebFormsRootDesigner.AddClientScriptToDocument

DesignTimeElementView: There is no current workaround. Users should be aware that the API will always return null in version 2.0.