开发者

Calling a Javascript function within C#

开发者 https://www.devze.com 2023-03-16 11:51 出处:网络
I am trying to pop something based on a condition... but it is not working... and I am kind of a newb开发者_开发技巧ie at this so I appreciate the help

I am trying to pop something based on a condition... but it is not working... and I am kind of a newb开发者_开发技巧ie at this so I appreciate the help

if (myFileName == OldFileName)
                {
                    btnSubmit.Attributes["OnClick"] = "return confirm('This file already exists, do you want to replace it?');";
                }

This is not being call for some reason.. here is the asp code

asp:Button class="Button" ID="btnSubmit" CausesValidation="True" Text="SUBMIT" runat="server"
            OnClick="btnSubmit_Click"></asp:Button>


use a ScriptManager.

ScriptManager.RegisterStartupScript()
ScriptManager.RegisterClientScriptBlock()

0

精彩评论

暂无评论...
验证码 换一张
取 消