How to call JavaScript function from code behind in C#? Example.

   <script type="text/javascript" language="javascript">
        function helloWorld(data) {
            alert(data);
        }
</script>
-----------------
 string strParamter = "Hello World test";
        ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript:helloWorld('" + strParamter + "'); ", true);


Share:

No comments:

Post a Comment

Wednesday, 26 June 2019

How to call JavaScript function from code behind in C#? Example.

   <script type="text/javascript" language="javascript">
        function helloWorld(data) {
            alert(data);
        }
</script>
-----------------
 string strParamter = "Hello World test";
        ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript:helloWorld('" + strParamter + "'); ", true);


No comments:

Post a Comment

Popular

Total Pageviews

Archive