Code Snippet posted by:
Niladri.Biswas | Posted on: 5/19/2012 | Category:
JavaScript Codes | Views: 672 | Status:
[Member] |
Points: 40
|
Alert Moderator
<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>
Best Regards,
Niladri Biswas