Add COMFIRM in ASP.NET.

zhaozj2021-02-16  58

After increasing the CONFIRM, you can prompt the operational user to confirm whether the operation is required, such as deleting operations.

Generally, it can be achieved by control.attribute.add ().

(1) Independent control.

For example, there is a Button control BTNDelete, increasing confim can be used

Btndelete.attributes.add ("Onclick", "Return Confirm (')");

(2) Add controls to DataGrid.

It is mainly implemented by the method of DataGID's itemcreated.

Private void DataGrid1_itemcreated (Object Sender, DataGriditeMeventargs E)

{IF (E.Item.itemType == ListItem TimemType == ListiteMTYPE.EDITITEM || E.Item.itemType == ListItemTYPE.AlternatingItem) {Button Btn = (Button) E.Item.FindControl ("btndel"); btn.attributes.add (....)}}

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

New Post(0)