I write this coding in C# in my sharepoint project. It works well.
ClientScript.RegisterStartupScript(this.GetType(), "ale", "window.open('DownloadHandler.ashx?fileName=Error.log');", true);
But when I change my coding to this, it no longer works.
ClientScript.RegisterStartupScript(this.GetType(), "ale", string.Format("window.open('DownloadHandler.ashx?fileName={0}')", "Error.log"), true);
What's wrong with my coding?
;at the end of thewindow.open()statement?