IEditableTextControl Interfaccia

Definizione

Rappresenta un controllo che esegue il rendering di testo che può essere modificato dall'utente.Represents a control that renders text that can be changed by the user.

public interface class IEditableTextControl : System::Web::UI::ITextControl
public interface IEditableTextControl : System.Web.UI.ITextControl
type IEditableTextControl = interface
    interface ITextControl
Public Interface IEditableTextControl
Implements ITextControl
Derivato
Implementazioni

Esempi

Nell'esempio di codice seguente viene illustrata un' TextChanged implementazione dell'evento.The following code example shows an implementation of the TextChanged event.


public partial class customeditablebox : System.Web.UI.UserControl, IEditableTextControl
{
    private static readonly object EventCustomTextChanged = new Object();

    public event EventHandler TextChanged
    {
        add
        {
            Events.AddHandler(EventCustomTextChanged, value);
        }
        remove
        {
            Events.RemoveHandler(EventCustomTextChanged, value);
        }
    }

    public string Text
    {
        get
        {
            // Provide implementation.
            return String.Empty;
        }
        set
        {
            // Provide implementation.
        }
    }
}
Public Class customeditablebox
    Inherits System.Web.UI.UserControl
    Implements System.Web.UI.IEditableTextControl

    Private Shared ReadOnly EventCustomTextChanged As New Object

    Public Custom Event TextChanged As EventHandler _
      Implements System.Web.UI.IEditableTextControl.TextChanged
        AddHandler(ByVal value As EventHandler)
            Events.AddHandler(EventCustomTextChanged, value)
        End AddHandler

        RemoveHandler(ByVal value As EventHandler)
            Events.RemoveHandler(EventCustomTextChanged, value)
        End RemoveHandler

        RaiseEvent(ByVal sender As Object, ByVal e As EventArgs)

        End RaiseEvent
    End Event

    Public Property Text() As String _
      Implements System.Web.UI.IEditableTextControl.Text
        Get
            ' Provide implementation.
            Return String.Empty
        End Get
        Set(ByVal value As String)
            ' Provide implementation.
        End Set
    End Property
End Class

Commenti

I controlli, ad TextBox esempio e quelli che derivano da ListControl, forniscono una proprietà di testo che può essere modificata da un utente della pagina.Controls, such as TextBox and those that derive from ListControl, provide a text property that can be changed by a page user. Quando la proprietà Text viene modificata, viene generato un evento per notificare ai gestori che la proprietà è stata modificata.When the text property is changed, an event is raised to notify handlers that the property has changed. Le classi che IEditableTextControl implementano devono TextChanged definire l'evento.Classes that implement IEditableTextControl must define the TextChanged event.

Anche se IEditableTextControl l'interfaccia contiene solo TextChanged l'evento ITextControl , eredita dall'interfaccia, che definisce una Text proprietà.Although the IEditableTextControl interface contains only the TextChanged event, it inherits from the ITextControl interface, which defines a Text property. Per implementare l' IEditableTextControl interfaccia, un controllo deve definire la Text proprietà e l' TextChanged evento che si verifica quando Text la proprietà passa da un post all'altra al server.To implement the IEditableTextControl interface, a control must define the Text property and the TextChanged event that occurs when the Text property changes between posts to the server.

IEditableTextControlviene implementato da TextBox e ListControl.IEditableTextControl is implemented by TextBox and ListControl. In queste classi, l'evento viene generato tramite i ListControl.OnTextChanged metodi TextBox.OnTextChanged o.In those classes, the event is raised through the ListControl.OnTextChanged or TextBox.OnTextChanged methods. Una classe che implementa l' IEditableTextControl interfaccia può definire un metodo simile per la generazione dell'evento.A class that implements the IEditableTextControl interface could define a similar method for raising the event.

Proprietà

Text

Ottiene o imposta il contenuto di testo di un controllo.Gets or sets the text content of a control.

(Ereditato da ITextControl)

Eventi

TextChanged

Si verifica quando il contenuto del testo viene modificato tra un invio e l'altro al server.Occurs when the content of the text changes between posts to the server.

Si applica a