Reputation: 14095
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?
Upvotes: 0
Views: 182
Reputation: 12366
So it's missing a semi colon ;
at the end.
ClientScript.RegisterStartupScript(this.GetType(), "ale", string.Format("window.open('DownloadHandler.ashx?fileName={0}');", "Error.log"), true);
Upvotes: 1
Reputation: 49238
There's a missing ;
at the end of the window.open()
statement:
ClientScript.RegisterStartupScript(
this.GetType(),
"ale",
string.Format("window.open('DownloadHandler.ashx?fileName={0}');", "Error.log"),
true
);
Upvotes: 2