Using Page.ClientScript.RegisterClientScriptBlock not working
<p>I am trying to fire a pop up as shown below, but it is not working. Please help</p>

<pre><code>public void btnSubmit_Click(Object o, EventArgs e)
{
    if (checkFileExists(Convert.ToString(fileInfo)))
    {
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Msg", "&lt;script type=\"text/javascript\"  language=\"javascript\"&gt;function showMsg(){return confirm(\"This image name already exists, do you want to replace it?\");}&lt;/script&gt;", true);
        btnSubmit.OnClientClick = "return showMsg()";
    }
    if (something else)
    {
        // It does whatever is here but never pops the question above
    }
}
</code></pre>

<p>and on the button I have</p>

<pre><code> &lt;asp:Button class="Button" ID="btnSubmit" CausesValidation="True" Text="SUBMIT" runat="server"
             OnClick="btnSubmit_Click"&gt;&lt;/asp:Button&gt;
</code></pre>
