DataGrid to join the audit function and delete confirmation dialog box [Figure] PCSKY (original)

zhaozj2021-02-16  92

NewsCheck.vb (code-behind) Private Sub DataGrid1_ItemDataBound (ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound Dim btnDel As LinkButton Dim btnCheck As LinkButton

If not (E.Item.itemType = _ ListItemType.Header OR _ E.Item.ItemType = ListItemType.footer) THEN

'Add to confirm BTNDEL = E.Item.cells (5) .controls (0) BTNDEL.Attributes.add ("onclick", "Once you want to delete this record?') ")

'Treatment of the Audit button Btncheck = E.Item.cells (3) .controls (0) if btncheck.text = 1 Then btncheck.text = "Audited" btncheck.enabled = false else btncheck.text = "to be review" end If end if end sub 'Note: When the article is not reviewed, the "To Review" button is displayed, and the button will turn into a gray-not available. 'The specific processing code of audit and deletion can be added in DataGrid1_DeleteCommand and DataGrid1_ItemCommand.

转载请注明原文地址:https://www.9cbs.com/read-12072.html

New Post(0)