Read C# DateTime function in Javascript

Niladri.Biswas
Posted by Niladri.Biswas under JavaScript category on | Points: 40 | Views : 1629
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
function Test() {
var currentDate = '<%= DateTime.Now.ToString("MM/dd/yyyy") %>';
alert(currentDate);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="Test()" />
</div>
</form>
</body>
</html>

Comments or Responses

Login to post response