In server code, call one of the methods listed in the following table.
The following code example shows how to add client script to a page that executes when the user clicks a button that posts the page back to the server. The client script displays a pop-up window requesting the user to confirm the postback.
Protected Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim scriptText As String
scriptText = "return confirm('Do you want to submit the page?')"
ClientScript.RegisterOnSubmitStatement(Me.GetType(), _
"ConfirmSubmit", scriptText)
End Sub