我想显示来自C#代码而不是JavaScript的确认框。 当下列条件成立时,我可以弹出确认框吗?如何制作确认框?
这是迄今为止代码:
if (items.SelectedNode.ChildNodes.Count >= 1)
{
ScriptManager.RegisterStartupScript(this.nav_tree_items, typeof(string), "Alert", "alert('Hello');", true);
}
我已经尝试add.attributes,但不起作用。
我也试过以下,但在取消的点击也无妨执行一个动作:
if (items.SelectedNode.ChildNodes.Count >= 1)
{
ScriptManager.RegisterStartupScript(this.nav_tree_items, typeof(string), "Confirm", "Confirm('Hello');", true);
}
我必须具备的条件,只有那么它应该允许确认框。所以我更喜欢C#会比JavaScript更好 – Ish 2011-12-16 13:57:32