Export (0) Print
Expand All

ControlDesigner.UpdateDesignTimeHtml Method

Refreshes the design-time HTML markup for the associated Web server control by calling the GetDesignTimeHtml method.

Namespace: System.Web.UI.Design
Assembly: System.Design (in system.design.dll)

public virtual void UpdateDesignTimeHtml ()
public void UpdateDesignTimeHtml ()
public function UpdateDesignTimeHtml ()

The UpdateDesignTimeHtml method is called by the design host to update the display of the associated Web server control at design time, such as when the control has been modified. Also, a control designer can call the UpdateDesignTimeHtml method after modifying values of the control to update the display of the control.

NoteNote

If you are calling the ComponentChanged event, or using the PropertyDescriptor object to set properties, the IComponentChangeService interface calls the UpdateDesignTimeHtml method for you.

The following code example demonstrates how to respond to a Click event in a control designer to change the focus between regions in a multi-region control and use the UpdateDesignTimeHtml method to update the appearance of the control in the design host.

This code example is part of a larger example for the EditableDesignerRegion class.

// Handler for the Click event, which provides the region in the arguments.
protected override void OnClick(DesignerRegionMouseEventArgs e)
{
    if (e.Region == null)
        return;

    // If the clicked region is not a header, return
    if (e.Region.Name.IndexOf("Header") != 0)
        return;

    // Switch the current view if required
    if (e.Region.Name.Substring(6, 1) != myControl.CurrentView.ToString())
    {
        myControl.CurrentView = int.Parse(e.Region.Name.Substring(6, 1));
        base.UpdateDesignTimeHtml();
    }
}

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Show:
© 2014 Microsoft