我想顯示來自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