07-23-2023, 07:21 AM
Thank "Liko", just add a comment to his answer.
string jsFunc = "myFunc(" + MyBackValue + ")";
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "myJsFn", jsFunc, true);
Added single quotes (`'`) to variable, otherwise it will give error message:
string jsFunc = "myFunc('" + MyBackValue + "')";
string jsFunc = "myFunc(" + MyBackValue + ")";
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "myJsFn", jsFunc, true);
Added single quotes (`'`) to variable, otherwise it will give error message:
string jsFunc = "myFunc('" + MyBackValue + "')";