Design the form as follows:
<head runat="server">
<title></title>
<script type="text/javascript">
function checkcookies() {
if (navigator.cookieEnabled)
alert("Cookies are Enabled");
else
alert("Cookies are Disabled");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="checkcookies();" />
</div>
</form>
</body>
Output:
<head runat="server">
<title></title>
<script type="text/javascript">
function checkcookies() {
if (navigator.cookieEnabled)
alert("Cookies are Enabled");
else
alert("Cookies are Disabled");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="checkcookies();" />
</div>
</form>
</body>
Output:
No comments:
Post a Comment
Thank you for visiting my blog