I just asked the same question that closed, as this is your duplicate. Here is the gist of my decision:
Form fields are automatically retrieved from the browser cache, thus preserving historical data. while this is true, javascript code runs independently each time.
So, I created a small hidden field to hold a timestamp and compare it with javascript generation time.
Here is the code, I'm sure it can be implemented much better, although the time is short:
$(document).ready(function () { var date = new Date(); var clientMiliseconds = date.getTime(); clientMiliseconds = roundTime(clientMiliseconds); var serverTimeStamp = $('#' + '<%= hfTimeStamp.ClientID %>').val(); serverTimeStamp = roundTime(serverTimeStamp); alert(serverTimeStamp == clientMiliseconds); }); function roundTime(time) { time = Math.floor(time);
source share