I have a form that, when submitted, it simply pulls up the same page again. Only, on successful submit, the original form controls are hidden, and the confirmation message is displayed.
Now that I've added a Spam Protector on the form, how can hide it on successful submit? i tried this:
|Dim mySpamProtector As SpamProtector = Page.FindControl("SpamProtector1") |
|If Page.IsValid Then |
| mySpamProtector.Visible = False |
| mySpamProtector.Visible = True |
|End If |
...but it comes up with "object reference not set to an instance of an object". On my sitemap page, when I placed the SpamProtector control, I went into the advanced properties and made sure the ID is set to SpamProtector1.
How do I do this?