Hi recently i had a problem about checkboxes lists in webform. I tried to validate the checkboxes list if it is unclicked and pop up a alert box. I input the codes as follows:
If (CheckBoxList1.SelectedValue = False) Then
ShowMessage("Branch(es) are required")
End If
Private Sub ShowMessage(ByVal message As String)
Dim scriptString As String = "<script language=JavaScript>"
scriptString += "alert('" + message + "');"
scriptString += "</script>"
Page.RegisterStartupScript("ShowMessage", scriptString)
End Sub
But there an error show "Input string was not in a correct format. " when i tried to run the program. Can anyone help me solve the problem? thankx.
If (CheckBoxList1.SelectedValue = False) Then
ShowMessage("Branch(es) are required")
End If
Private Sub ShowMessage(ByVal message As String)
Dim scriptString As String = "<script language=JavaScript>"
scriptString += "alert('" + message + "');"
scriptString += "</script>"
Page.RegisterStartupScript("ShowMessage", scriptString)
End Sub
But there an error show "Input string was not in a correct format. " when i tried to run the program. Can anyone help me solve the problem? thankx.