In visual studio 2015 for a Kentico 9 project I created a custom web part that is placed on the home page. It has a Page_PreRender method and checks the date and time of the emergency page with the current date and time and if there is a difference in the time stamp and the difference in the time stamp is within a 24 hour period of the current time it makes an emergency icon flash until the 24 hour period ends or they go and update the emergency page by clicking on the Save buton again. I also have a counter to check how many times the Save button is clicked. The above data is queried from the database since the timestamps etc are saved when the Save button is clicked. In short one click, Saves the emergency page and the emergency icon starts to flash. If you click on the Save button again (for a 2nd time) it switches of the the Flashing of the Emergency Icon. This was necessary if the emergency page content was changed but there was not a real/immediate emergency that warrant a flashing emergency icon to make users aware.The above worked when we did not have a workflow in place for Kentico. Since a workflow was added and there is a publish/reject buttons. Clicking on the Publish button makes the emergency icon to flash and you end up in a battle between the Save button and the Publish button. I can turn off the WorkFlow for the Emergency page but want to see if there is a way to check if the publish button was clicked.My question is how do I check which button was clicked in the Page_PreRender method using the Kentico buttons Save/Publish/Reject etc. in an if condition?
↧