I have a hidden field in my master page. And I set the current date and time as a value in that \"hiddenfield\" using Javascript. I am unable to get this hidden field value
'Is there any other way to get the current date time in any of my page. I don't want to use Session and cookies.' In that case you can use JavaScript
Also, you don't need to use RegisterStartupScript
. You can just call the GetDate()
function in the onLoad
event.
However, you might want to read this SO thread for best practice in using window.onload
, or consider using a framework such as jQuery and its document.ready