I have a contact form contained within a div. I would like to hide the contact form when it is submitted and display a success type message such as what you have done in your book.
However it wont let me reference the div in the code behind file.
I was originially trying to do something like this in the btnSubmit click event handler.
Code:
lblSuccess.Visible = True
contact1.Visible = False
However this throws an exception because contact1 is a div(I can only assume).
So as far as I can tell I have 2 options. The first longer option is to declare the visibility of each label and control to false when the button is clicked.
The second is to do a Response.redirect to a page just the same but which has the message in it.
Neither of these are ideal the first option is quite long and I don't really want to redirect people either.
So is there a better way that I am missing?