0

I need to run a piece of javascript code, and based on the result of that function, i need to execute something in .net

I tried the following method to execute the javascript code from the aspx.cs file

        ClientScript.RegisterStartupScript
    (GetType(), "Javascript", "javascript: hola( ); ", true);

When I go into debug mode though, and I put a breakpoint in the javascript code, the program never gets there. Thus I believe the above method to call javascript is not working. What am I doing wrong?

Slow Harry
  • 1,857
  • 3
  • 24
  • 42
user3171919
  • 99
  • 1
  • 1
  • 7
  • 2
    Please decide if you need to run Java or JavaScript code... There are some "minor" differences... – Alexei Levenkov Jan 26 '14 at 08:38
  • Try with following SO discussion: http://stackoverflow.com/questions/16484978/clientscript-registerstartupscript-not-working – user3184772 Jan 26 '14 at 09:47
  • Try using other conventional methods like console log or alert to confirm that your code block is not running for sure. Also, I believe that "hola();" should suffice. – Raúl Roa Jan 26 '14 at 12:07
  • So just to be clear, I can put .js file that contains hola() in the solution, and this should theoretically work? – user3171919 Jan 27 '14 at 00:46

0 Answers0