【发布时间】:2014-04-07 11:15:15
【问题描述】:
您好,我想从 asp.net 中的代码调用客户端 javascript 确认消息。
我想使用确认消息中的真或假返回值。
我正在这样做,但这不是正确的方法,请告诉我我该怎么做。
ScriptManager.RegisterStartupScript(this, this.GetType(), "myconfirm", "confirm('No Rule Type Ids found for This Rule.');", true);
【问题讨论】:
-
我更喜欢使用 typeof(MyPage) 而不是 GetType() 来保存反射(除非您显然在基本页面上)
-
我认为最好在 html 部分添加确认 onclientclick="return confirm('Are you sure, you want to continue?');
标签: c# javascript asp.net