Επεξεργασία

Κοινή χρήση μέσω


DeviceSpecificChoiceCollection.Add(DeviceSpecificChoice) Method

Definition

Adds a DeviceSpecificChoice object to the end of a collection. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public:
 void Add(System::Web::UI::MobileControls::DeviceSpecificChoice ^ choice);
public void Add (System.Web.UI.MobileControls.DeviceSpecificChoice choice);
member this.Add : System.Web.UI.MobileControls.DeviceSpecificChoice -> unit
Public Sub Add (choice As DeviceSpecificChoice)

Parameters

choice
DeviceSpecificChoice

The DeviceSpecificChoice object to add to the end of the collection.

Examples

The following code example demonstrates how to use the Add method to add a DeviceSpecificChoice object programmatically (with a filter named isCHTML10) to the form. This example is part of a larger example for the DeviceSpecificChoiceCollection overview.

// Add a DeviceSpecificChoice section programatically
protected void form1_Init(object sender, EventArgs e)
{
    DeviceSpecific devSpecific = Panel1.DeviceSpecific;
    DeviceSpecificChoice devChoiceHtml = new DeviceSpecificChoice();
    devChoiceHtml.Filter = "isCHTML10";
    devSpecific.Choices.Add(devChoiceHtml);
    ((IParserAccessor)form1).AddParsedSubObject(devSpecific);
}
' Add a DeviceSpecificChoice section programatically
Protected Sub form1_Init(ByVal sender As Object, ByVal e As EventArgs)
    Dim devSpecific As DeviceSpecific = Panel1.DeviceSpecific
    Dim devChoiceHtml As DeviceSpecificChoice = New DeviceSpecificChoice()
    devChoiceHtml.Filter = "isCHTML10"
    devSpecific.Choices.Add(devChoiceHtml)
    CType(form1, IParserAccessor).AddParsedSubObject(devSpecific)
End Sub

Applies to

See also