IButtonControl 介面

定義

定義必須實作的屬性和事件,以允許控制項在網頁上像按鈕運作。Defines properties and events that must be implemented to allow a control to act like a button on a Web page.

public interface class IButtonControl
public interface IButtonControl
type IButtonControl = interface
Public Interface IButtonControl
衍生

備註

IButtonControl介面會定義必須實作用的屬性和事件, 以便讓控制項如同網頁上的按鈕般運作。The IButtonControl interface defines the properties and events that must be implemented to allow a control to act like a button on a Web page.

此介面的成員提供基本按鈕功能, 例如引發Click事件Command和事件的功能。The members of this interface provide basic button functionality, such as the ability to raise a Click event and a Command event. PostBackUrl屬性會提供跨頁面的張貼功能。The PostBackUrl property provides cross-page posting functionality.

給實施者的注意事項

在與網頁上的按鈕控制項類似的類別中, 執行此介面。Implement this interface in classes that act like button controls on Web pages.

屬性

CausesValidation

取得或設定數值,表示按一下按鈕是否會導致發生頁面驗證。Gets or sets a value indicating whether clicking the button causes page validation to occur.

CommandArgument

取得或設定傳播至 Command 事件的選擇性引數。Gets or sets an optional argument that is propagated to the Command event.

CommandName

取得或設定傳播至 Command 事件的命令名稱。Gets or sets the command name that is propagated to the Command event.

PostBackUrl

取得或設定網頁 URL,在按一下按鈕控制項時會從目前頁面傳送至這個網頁。Gets or sets the URL of the Web page to post to from the current page when the button control is clicked.

Text

取得或設定顯示在按鈕上的文字標題。Gets or sets the text caption displayed for the button.

ValidationGroup

取得或設定控制項群組的名稱,會在按鈕控制項回傳至伺服器時,針對這個群組引發驗證。Gets or sets the name for the group of controls for which the button control causes validation when it posts back to the server.

事件

Click

當按一下按鈕控制項時發生。Occurs when the button control is clicked.

Command

當按一下按鈕控制項時發生。Occurs when the button control is clicked.

適用於