Delete button in DataGrid (ImageButton)

xiaoxiao2021-03-06  88

Private sub DTGSellers_itemdatabase (byvale) Handles DTGUSERS.ITEMDATABOUND

'Add Delete Confirm

DIM btn as imagebutton = E.Item.cells (7) .findcontrol ("btndelete")

btn.attributes.add ("onclick", "JavaScript: return control ('OK is to delete?');")

End Sub

Private sub DTGUSERS_DELETECOMMAND (Byval e as system.Web.ui.WebControls.DataGridCommandeventArgs) Handles DTGUSERS.DELETECOMMAND

DIM User As new cmn_user

Dim link as hyperlink = E.Item.cells (1) .FindControl ("lnkseller")

User.pk_user_id = line.text

User.create_id = ctype (Session ("UserInfo", CMN_USER) .pk_user_id

DIM Useraccess As New CMN_UserFacade

IF useeraccess.removeause = edataaccessstate.Normal Then

Alertscript.showalert (ME, ", Alertscript.Message.DeletesUccess)

Else

Alertscript.showalert (ME, ", Alertscript.Message.Deletefailed)

END IF

ViewState.Item ("User_Status") = "delete"

'Refresh Data

DataGridbind () End Sub

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

New Post(0)