Retrieving a checkbox value
Posted on 2007-11-20
I am using the LoggingIn event with my log in control.
Within this event I am trying to get the value of the RememberMe checkbox in VB.
I use the following code...
Dim rememberme As CheckBox = CType(FindControl("RememberMe"), CheckBox)
I tried both of these and the first doesn't error, but also doesn't hit the code when the checkbox is checked or even if it isn't:
If Not rememberme Is Nothing Then
This second one errors with: "System.NullReferenceException: Object reference not set to an instance of an object."
If (rememberme.Checked) Then
How do I check to see if the checkbox is checked?