TagPrefixCollection.Item[Int32] Egenskap
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar eller anger objektet TagPrefixInfo på den angivna indexplatsen.
public:
property System::Web::Configuration::TagPrefixInfo ^ default[int] { System::Web::Configuration::TagPrefixInfo ^ get(int index); void set(int index, System::Web::Configuration::TagPrefixInfo ^ value); };
public System.Web.Configuration.TagPrefixInfo this[int index] { get; set; }
member this.Item(int) : System.Web.Configuration.TagPrefixInfo with get, set
Default Public Property Item(index As Integer) As TagPrefixInfo
Parametrar
- index
- Int32
Indexet för ett TagPrefixInfo objekt i samlingen.
Egenskapsvärde
Objektet TagPrefixInfo i det angivna indexet eller null om det inte finns något objekt i indexet.
Exempel
Följande kodexempel visar hur du använder egenskapen Item[] . Det här kodexemplet är en del av ett större exempel för PagesSection klassen.
// Get all current Controls in the collection.
for (int i = 0; i < pagesSection.Controls.Count; i++)
{
Console.WriteLine("Control {0}:", i);
Console.WriteLine(" TagPrefix = '{0}' ",
pagesSection.Controls[i].TagPrefix);
Console.WriteLine(" TagName = '{0}' ",
pagesSection.Controls[i].TagName);
Console.WriteLine(" Source = '{0}' ",
pagesSection.Controls[i].Source);
Console.WriteLine(" Namespace = '{0}' ",
pagesSection.Controls[i].Namespace);
Console.WriteLine(" Assembly = '{0}' ",
pagesSection.Controls[i].Assembly);
}
' Get all current Controls in the collection.
Dim j As Int32
For j = 0 To pagesSection.Controls.Count - 1
Console.WriteLine("Control {0}:", j)
Console.WriteLine(" TagPrefix = '{0}' ", _
pagesSection.Controls(j).TagPrefix)
Console.WriteLine(" TagName = '{0}' ", _
pagesSection.Controls(j).TagName)
Console.WriteLine(" Source = '{0}' ", _
pagesSection.Controls(j).Source)
Console.WriteLine(" Namespace = '{0}' ", _
pagesSection.Controls(j).Namespace)
Console.WriteLine(" Assembly = '{0}' ", _
pagesSection.Controls(j).Assembly)
Next
Kommentarer
Den här egenskapen skriver TagPrefixInfo över objektet om det redan finns i det angivna indexet. Annars skapas ett nytt objekt och läggs till i samlingen.