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.

適用於