我在C#中編寫我的sharepoint項目中的這種編碼。它運作良好。C#中的javascript問題#
ClientScript.RegisterStartupScript(this.GetType(), "ale", "window.open('DownloadHandler.ashx?fileName=Error.log');", true);
但是,當我改變我的編碼,這不再起作用。
ClientScript.RegisterStartupScript(this.GetType(), "ale", string.Format("window.open('DownloadHandler.ashx?fileName={0}')", "Error.log"), true);
我的編碼有什麼問題?
定義「不再有效」嗎? – 2011-12-27 03:05:37
我不知道,'window.open()'語句末尾有一個';'缺少嗎? – 2011-12-27 03:07:22
@kevin在javascript結尾缺少分號? – Nalaka526 2011-12-27 03:08:15