Я пытаюсь запустить всплывающее окно, как показано ниже, но оно не работает. Пожалуйста, помогите
public void btnSubmit_Click(Object o, EventArgs e)
{
if (checkFileExists(Convert.ToString(fileInfo)))
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Msg", "<script type=\"text/javascript\" language=\"javascript\">function showMsg(){return confirm(\"This image name already exists, do you want to replace it?\");}</script>", true);
btnSubmit.OnClientClick = "return showMsg()";
}
if (something else)
{
// It does whatever is here but never pops the question above
}
}
а на кнопке у меня
<asp:Button class="Button" ID="btnSubmit" CausesValidation="True" Text="SUBMIT" runat="server"
OnClick="btnSubmit_Click"></asp:Button>