Code:[Convert to VB if required]
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Alert", "<script type='text/javascript'>testmsg('This is the alert you want');</script>", false);
JavaScript:
<script type="text/javascript">
function testmsg(msg) {
alert(msg);
}
</script>