I have this code for a click event of a button:
protected void Button1_Click(object sender, EventArgs e)
{
string message = "";
//Series of codes to change the message variable
Page.ClientScript.RegisterStartupScript(GetType(), "", "ShowMessage(" + message +");", true);
}
<script type="text/javascript">
function ShowMessage(msg){
alert(msg);
}
</script>
and this won't display the message. maybe my RegisterStartupScript is incorrect?