BulletedListEventArgs Sınıf
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Bir BulletedList denetimin Click olayı için veri sağlar.
public ref class BulletedListEventArgs : EventArgs
public class BulletedListEventArgs : EventArgs
type BulletedListEventArgs = class
inherit EventArgs
Public Class BulletedListEventArgs
Inherits EventArgs
- Devralma
Aşağıdaki örnek, bir denetimin olayı için bir olay işleyicisinin nasıl belirtileceğini ve kodleneceğini ClickBulletedList gösterir. Bir liste öğesine tıklandığında, sayfada bir Label ileti görüntülenir.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>BulletedList Click Example</title>
<script runat="server">
void ItemsBulletedList_Click(object sender, System.Web.UI.WebControls.BulletedListEventArgs e)
{
// Change the message displayed in the label based on the index
// of the list item that was clicked.
switch (e.Index)
{
case 0:
Message.Text = "You clicked list item 1.";
break;
case 1:
Message.Text = "You clicked list item 2.";
break;
case 2:
Message.Text = "You clicked list item 3.";
break;
default:
throw new Exception("You did not click a valid list item.");
break;
}
}
</script>
</head>
<body>
<h3>BulletedList Click Example</h3>
<form id="form1" runat="server">
<p>Click on an item in the list to raise the Click event.</p>
<asp:BulletedList id="ItemsBulletedList"
BulletStyle="Disc"
DisplayMode="LinkButton"
OnClick="ItemsBulletedList_Click"
runat="server">
<asp:ListItem Value="http://www.cohowinery.com">Coho Winery</asp:ListItem>
<asp:ListItem Value="http://www.contoso.com">Contoso, Ltd.</asp:ListItem>
<asp:ListItem Value="http://www.tailspintoys.com">Tailspin Toys</asp:ListItem>
</asp:BulletedList>
<asp:Label id="Message"
Font-Size="12"
Width="168px"
Font-Bold="True"
runat="server"
AssociatedControlID="ItemsBulletedList"/>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>BulletedList Click Example</title>
<script runat="server">
Sub ItemsBulletedList_Click(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.BulletedListEventArgs)
' Change the message displayed in the label based on the index
' of the list item that was clicked.
Select Case (e.Index)
Case 0
Message.Text = "You clicked list item 1."
Case 1
Message.Text = "You clicked list item 2."
Case 2
Message.Text = "You clicked list item 3."
Case Else
Throw New Exception("You did not click a valid list item.")
End Select
End Sub
</script>
</head>
<body>
<h3>BulletedList Click Example</h3>
<form id="form1" runat="server">
<p>Click on an item in the list to raise the Click event.</p>
<asp:BulletedList id="ItemsBulletedList"
BulletStyle="Disc"
DisplayMode="LinkButton"
OnClick="ItemsBulletedList_Click"
runat="server">
<asp:ListItem Value="http://www.cohowinery.com">Coho Winery</asp:ListItem>
<asp:ListItem Value="http://www.contoso.com">Contoso, Ltd.</asp:ListItem>
<asp:ListItem Value="http://www.tailspintoys.com">Tailspin Toys</asp:ListItem>
</asp:BulletedList>
<asp:Label id="Message"
Font-Size="12"
Width="168px"
Font-Bold="True"
runat="server"
AssociatedControlID="ItemsBulletedList"/>
</form>
</body>
</html>
Olay Click , denetimdeki BulletedList bir bağlantı düğmesine tıklandığında oluşturulur.
Sınıfının bir örneğinin ilk özellik değerlerinin BulletedListEventArgs listesi için oluşturucuya BulletedListEventArgs bakın.
Bulleted |
BulletedListEventArgs sınıfının yeni bir örneğini başlatır. |
Index |
Olayı tetikleyen bir BulletedList denetimdeki liste öğesinin dizinini alır. |
Equals(Object) |
Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler. (Devralındığı yer: Object) |
Get |
Varsayılan karma işlevi işlevi görür. (Devralındığı yer: Object) |
Get |
Type Geçerli örneğini alır. (Devralındığı yer: Object) |
Memberwise |
Geçerli Objectöğesinin sığ bir kopyasını oluşturur. (Devralındığı yer: Object) |
To |
Geçerli nesneyi temsil eden dizeyi döndürür. (Devralındığı yer: Object) |
Ürün | Sürümler |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET geri bildirimi
.NET, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin: