Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim ResourceObject As Object
Dim js As [String] = (vbCr & vbLf & " if(confirm('Are you sure you want to delete from the list?')==true)" & vbCr & vbLf & " document.getElementById('" & txtRespuesta.ClientID & "').value='true';" & vbCr & vbLf & " else" & vbCr & vbLf & " document.getElementById('") + txtRespuesta.ClientID & "').value='false';" & vbCr & vbLf & " "
ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "Key", js, True)
If txtRespuesta.Text = False Then
-Action 1
Else
-Action 2
End If
End Sub
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<tr >
<td align="center" colspan="2">
<asp:TextBox ID="txtRespuesta" runat="server" Width="174px" Height="21px"
MaxLength="20" style="font-weight: 700" Font-Names="Verdana" TabIndex="2"></asp:TextBox>
</td>
</tr>
<asp:Button ID="btnUpdate" runat="server" Height="28px"
style="font-weight: 700" Text="変更" Width="68px" TabIndex="3" />
<asp:Button ID="btnDelete" runat="server"
</script>
</ContentTemplate>
</asp:UpdatePanel>
JavaScript function called from server-side code not functioning correctly.