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.

適用於