In my register page I have a checkbox (chkAgree
) next to the terms of agreement. The register (btnRegister
) button is disabled until chkAgree.Checked = True
. Since the registration section is toward the bottom of the page I want to redirect the user to an anchor tag during the event. I can't seem to accomplish this without one of the two objects in question losing their status. I tried creating a Session
for each object and then calling them on the page load event with no luck. I am obviously doing it wrong, but could someone please point me in the right direction? btnRegister
's default status is set to Enabled=False
. Here are the two methods I am using
CheckedChanged:
Protected Sub chkAgree_CheckedChanged(sender As Object, e As EventArgs) Handles chkAgree.CheckedChanged
Session("Agree") = chkAgree.Checked
Response.Redirect("~/ExteriorStudentTestimonials.aspx#register", False)
End Sub
And Page_Load:
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Session("Agree") = True Then
btnRegister.Enabled = True
chkAgree.Checked = True
Else
btnRegister.Enabled = False
chkAgree.Checked = False
End If
End Sub
I have tried several different combinations of If
statements but cannot figure it out without taking Response.Redirect("~/ExteriorStudentTestimonials.aspx#register", False)
out.