jadachDevClub member 3/21/2019 | |
Can you put a reload or redirect to add page if an error occurs? You could display the error message via a session variable so not to confuse the user. |
Pete K author 3/22/2019 | |
Can you put a reload or redirect to add page if an error occurs? You could display the error message via a session variable so not to confuse the user.
|
admin 3/22/2019 | |
This is definitely not happening in my test ASPRunner.NET 10.1 project. |
Pete K author 3/23/2019 | |
This is definitely not happening in my test ASPRunner.NET 10.1 project. http://demo.asprunne.../categories/add BeforeDisplay event prints "yes" in the top left corner and Javascript onload event hides Description control. Just enter category name and click Save.
|
admin 3/23/2019 | |
Pete, |
Pete K author 3/25/2019 | |
Pete, on your screenshot the control is hidden. What you see is a label which wasn't meant to be hidden. The point is that both server and client events are executed.
|
admin 3/25/2019 | |
Just to make sure that no other code gets in the way start by removing all code from BeforeAdd event but "return false;" and see what happens. |
Pete K author 3/26/2019 | |
I figured it out. In the case of the server code, my code was dependent on a URL querystring which was not getting repeated upon the postback. I solved that by changing it to a session variable. In the case of the client code, I foolishly forgot that the state of my show/hide code was dependent on the OnChange event being fired by the changing of a control. I updated the JavaScript to fire the OnChange event upon loading if it is a postback (submit=1). |