Add a method of adding a delete button for the DataGrid control in VB.NET

zhaozj2021-02-12  157

When you develop an ASP.NET web application, you will encounter such situations: You need to add a client script code to an ASPX page. There are two different ways that allows you to add this code at runtime. The first method is to use the RegisterClientScriptBlock method of the PAGE control, which allows you to add code to an ASPX page at runtime. This method has two parameters - Key and Script. The parameter key is unique, you can identify each Script block you added to the page. You can use the isclientScriptBlockRegistered property and the value of Key to avoid repeating the script code. The parameter script is a string that contains your client script code. When the user clicks on a button, the following JavaScript code will prompt them to confirm:

Private Sub Page_Load (byval sender as Object, ByVal e as EventArgs) 'Create your script code Dim sScript as String = "