Thursday, July 14, 2011

how to call a messagebox in asp .net code-behind

This is how to call a messagebox in asp .net code-behind:

First, create a javascript in your aspx file:

<script type="text/javascript">
function alertMessage(someval) {
alert(someval);
}
</script>

Then, in code-behind, call the function using this:

ClientScript.RegisterStartupScript(typeof(Page), "myscript2", "");

Happy cooking programmers!

No comments: