
Sending a prompt alert using a JavaScript function..

JavaScript Alert box - you can also call it interactive boxes. As these alerts make a simple communication between the application and it's user. For example if a user enters a wrong password or ID then it need to be restricted to access the page. But the question is, how a user will understand that he/she is a unauthorized user?
The answer is "JavaScript Prompt Alert" it will tell the user that you are unauthorized. Find the given code that explains how to create a prompt alert in your JavaScript application.
string prompt =
"<script type=\"text/javascript\">alert('This Alert for an unauthorized user'); </script>";
ClientScript.RegisterStartupScript(typeof (Page), "alert", prompt);

Javascript Alert box:
<html>
<head>
<script type="text/javascript">
function show()
{
alert("This is an alert box!");
}
</script>
</head>
<body>
<input type="button" onclick="show()" value="Show alert box" />
</body>
</html>

Javascript prompt box:
<html>
<head>
<script type="text/javascript">
function show()
{
var name=prompt("Enter your name","");
alert("Hello " + name + "!");
}
}
</script>
</head>
<body>
<input type="button" onclick="show()" value="Show prompt box" />
</body>
</html>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.