hi
i want to diaplay a messagebox in asp.net..how can i do this.. can anyone suggest me a code in c#..can i use the alert function..if so whats the code..i even want the ok and cancel button on the msgbox..kindly suggest me the code for this..
thank you
This is very easy in javascript
:
Go to source/Html page (in .aspx) and write this function.
<script type="text/javascript">
function ConfirmMsg()
{
if( confirm('Are you sure?') )
{
return true;
}
else
{
return false;
}
}
</script>
Note: "confirm" must be in lower caption.
call this function in Button OnClientClick:
OnClientClick="return ConfirmMsg()"
Another way also we can write it directly in the button OnClientClick:
OnClientClick="return confirm('Are you Sure?')"