Answers for "function js in html c# with parameters"

0

how to call javascript function with parameter in c#

string updateProgress = "18%";
    ClientScript.RegisterStartupScript(this.GetType(), "updateProgress", "updateProgress('" + updateProgress + "');", true);
Posted by: Guest on February-15-2022
0

passing parameters from C# to js fucntions

<!--First the html-->
<script type="text/javascript"> 
        function updateProgress(percentage) {          
            document.getElementById('ProgressBar').style.width = percentage+"%";
        }
</script> 
<!--Define your function or call it from a .js file-->
<!--On the C# Code behind-->
 string updateProgress = "18%";
 ClientScript.RegisterStartupScript(this.GetType(), "updateProgress", "updateProgress('" + updateProgress + "');", true);
<!--You can pass C# variables as parameters to the js function this way: '" + param + "'-->
Posted by: Guest on June-05-2021

Code answers related to "function js in html c# with parameters"

Browse Popular Code Answers by Language