The beginning of last week I finished work one one of my pages. It worked
just fine. I use update panel on it so the user would be able to enable
or disable certain sections as he/she would need it. The page is for
the user to be able to request a insurance quote.
On thursday night I just opened the page as I wanted to test something and I then discovered that NONE of the buttons on the page works. At first I thought maybe I did something to the code by accident, but the page does not give me ANY errors nor could I found anything wrong. I then tried a dropdown that causes a postback and that worked. I then tried declaring a new button, but still... no postback. I then tried a backup of the page to see if it might not be firefix or explorer causing it. The backup worked... and so does every other page with similar controls. Only difference between the backup and the current is the current has Gridviews on it. I have even tried to make a new page and then just put everytning on the new page, but nothing. It's like clicking on a Windows form button which has no Click event.
I simply have no idea what it could. Like I said... it worked fine the beginning of last week, I didn't do ANY work on it since, but Thursday night it just didn't work. I was hoping some might have had a similar problem and might know how to fix it.
Thanks
NeCroFirePosted Aug 21, 2008, 2:48 AM
Found the problem last night... kind of by accident.
I was looking through all the properties of a button when "CausesValidation" caught my eye. Not sure how it worked I figured it would most likely be something that returns TRUE or FALSE, and I thought maybe it's not returning anything and that might be why there is nothing happening when you click a button. The default is TRUE, so I set it to FALSE on two buttons and gave it a go.
And there the two buttons work.
So then I did a quick Google on this property and as I suspected it's does return TRUE or FALSE. I'm guessing it's not returning anything and that is why the page does not do anything because it probably does not compensate for this? For anyone who might not know, it's for validation controls like the "RequireFieldValidator", ect. Set the property to false on the button and these validations won't be done. And this is my new problem.
The buttons work now, but now my validations are not being done. Would it be best to do some validations in the code behind or is there another way to have the validations working with the property set to false on the buttons?
Thanks