ClientScript.RegisterStartupScript(
Page.GetType(),
"INFORMATION",
@"PopupMessage(""INFORMATION"", ""Data was created successfully"", false);",
true);
The code above show the JavaScript code in C# code behind
What I want to do is add the variable to the message
but I used this code which does not work:
ClientScript.RegisterStartupScript(
Page.GetType(),
"INFORMATION",
@"PopupMessage(""INFORMATION"", """+Data+" was created successfully"", false);",
true);
It throws error:
Error CS1501 No overload for method 'RegisterStartupScript' takes 5 arguments
Does someone know how to make it work?
@only applies to the string literal immediately following it, not to any other literals in the same expression - see David's answer