hi Try this code...
if any doubt , leave a comment..
protected void btnsubmit_Click(object sender, EventArgs e)
{
bool value = true;
if (value)
{
string script = " <script type=\"text/javascript\"> var val = confirm('ur message ???'); if(val){calfun();} </script> ";
ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", script, false);
}
}
<script type="text/javascript">
function calfun()
{
alert('calling');
}
</script>