问题描述
我有一个转发器一页。列克这个
从到出发到达操作
LHR JFK 25july 30aug ButtonDeleteSector
LHR JFK 25july 30aug ButtonDeleteSector
LHR JFK 25july 30aug ButtonDeleteSector
现在,当我点击特定行上的特定按钮时,它应该是删除单击的行。所以我在html中为按钮创建了这个按钮
I have one repeater one page. Liek this
From To depart arrive operation
LHR JFK 25july 30aug ButtonDeleteSector
LHR JFK 25july 30aug ButtonDeleteSector
LHR JFK 25july 30aug ButtonDeleteSector
now, when I click particular button on particular row, then it should delete the clicked row. So I created this in html for the buttons
<td class="ItemTemplate" style="text-align: left; width: 75px;">
<asp:Button ID="btnDeleteSector" runat ="server" Text="Delete Sector" CommandName ="Delete" UseSubmitBehavior ="false"/>
</td>
在VB代码中
And in the VB code
Protected Sub rptDatabaseItinerary_Delete_Sector(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles rptDatabaseItinerary.ItemCommand
If e.Item.ItemType = ListItemType.Item Then
Dim btnDeleteSector As Button = CType(e.Item.FindControl("btnDeleteSector"), Button)
Dim id As String = btnDeleteSector.CommandArgument
End If
If e.CommandName = "Delete" Then
For Each objSector As Calrom.BLL.Common.BookingModel.Sector In DatabaseBookingPart.Sectors()
If e.Item.ItemIndex = 0 Then
objSector.Status = BLL.Common.BookingModel.Status.Deleted
End If
Next
rptDatabaseItinerary.DataBind()
End If
End Sub
但是它正在删除所有扇区,任何人都可以告诉我如何选择特定行并删除它。
but it is deleting the all sectors, Can anyone tell me how can i select the particualr row and delete it.
推荐答案
这篇关于如何从转发器中选择数据,然后单击同一转发器中的按钮将其删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!