Control.GetUniqueIDRelativeTo(Control) Control.GetUniqueIDRelativeTo(Control) Control.GetUniqueIDRelativeTo(Control) Method

定义

返回指定控件的 UniqueID 属性的前缀部分。Returns the prefixed portion of the UniqueID property of the specified control.

public:
 System::String ^ GetUniqueIDRelativeTo(System::Web::UI::Control ^ control);
public string GetUniqueIDRelativeTo (System.Web.UI.Control control);
member this.GetUniqueIDRelativeTo : System.Web.UI.Control -> string

参数

control
Control Control Control

位于命名容器内的控件。A control that is within a naming container.

返回

指定控件的 UniqueID 属性的前缀部分。The prefixed portion of the UniqueID property of the specified control.

异常

注解

控件UniqueID的属性是通过将前缀添加到控件的ID属性来生成的。The UniqueID property of a control is generated by adding a prefix to the control's ID property. 前缀由与分隔符连接的UniqueID控件的命名容器的属性组成。The prefix is composed of the UniqueID property of the control's naming container concatenated with a separator character. 如果命名容器是页面,则没有前缀。If the naming container is the page, there is no prefix. 此方法返回前缀字符串。This method returns the prefix string. 如果没有前缀字符串,则它将返回控件UniqueID的值。If there is no prefix string, it returns the UniqueID value of the control.

适用于