0

I am having a weird issue.

I have this function in a Javascript file which is imported in the header section of the .html:

function MyJSFunction(param){
    console.log(param);
}

Having this snippet in a button click event (which it works and fires properly):

ScriptManager.RegisterClientScriptBlock(this, typeof(System.Web.UI.Page), "MyJSFunction", "MyJSFunction('hello world')", true);

I do have the ScriptManager correctly imported in the .aspx file.

What am I doing wrong?

Thanks!

Diogo Santos
  • 780
  • 4
  • 17
  • A possible duplicate of https://stackoverflow.com/questions/4848678/how-to-call-javascript-function-from-code-behind – Outman Oct 24 '18 at 11:10
  • Possible duplicate of [How to call javascript function from code-behind](https://stackoverflow.com/questions/4848678/how-to-call-javascript-function-from-code-behind) – Tetsuya Yamamoto Oct 25 '18 at 02:12

0 Answers0