WebControl.CopyBaseAttributes(WebControl) WebControl.CopyBaseAttributes(WebControl) WebControl.CopyBaseAttributes(WebControl) WebControl.CopyBaseAttributes(WebControl) Method

定义

Style 对象未封装的属性从指定的 Web 服务器控件复制到从中调用此方法的 Web 服务器控件。Copies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

public:
 void CopyBaseAttributes(System::Web::UI::WebControls::WebControl ^ controlSrc);
public void CopyBaseAttributes (System.Web.UI.WebControls.WebControl controlSrc);
member this.CopyBaseAttributes : System.Web.UI.WebControls.WebControl -> unit
Public Sub CopyBaseAttributes (controlSrc As WebControl)

参数

controlSrc
WebControl WebControl WebControl WebControl

WebControl,它表示属性要复制到从中调用此方法的 Web 服务器控件的源控件。A WebControl that represents the source control with properties to be copied to the Web server control that this method is called from.

异常

注解

CopyBaseAttributes方法将Enabled、、 、和Attributes属性从指定的 web 服务器控件复制到从中调用此方法的 web 服务器控件。 ToolTip AccessKey TabIndexThe CopyBaseAttributes method copies the AccessKey, Enabled, ToolTip, TabIndex, and Attributes properties from the specified Web server control to the Web server control that this method is called from. 这通常用于 Web 服务器控件在呈现和使用控件时动态创建新控件的工作情况。This is commonly used in cases where a Web server control works by dynamically creating new controls while it is rendering and using the controls. 此方法在这种情况下很有用,因为它复制不是由Style对象封装的 Web 服务器控件的所有属性,因此它们可以放置在要呈现的标记的最外面的控件上。This method is useful in this situation because it copies all properties of Web server controls not encapsulated by the Style object so they can be placed on the outermost control of a tag that is being rendered.

适用于

另请参阅