Diff RegisterClientScriptBlock & RegisterStartupScript & responce.write ("script")

I need an individual explanation and individual advantages in relation to RegisterClientScriptBlockand RegisterStartupScriptandresponce.write("script");

I got some information like

RegisterClientScriptBlock() methods will enter the script after the open form tag, but before the page controls

RegisterStartupScript() methods will inject scripts after the page controls, but before the form closing tag.

we can also just wrie responce.write("script")he also include the script.

but I need an individual explanation

if any link is available on this topic, also answer me.

+3
source share
1 answer

RegisterClientScriptBlock(), javascript html-, , script. RegisterStartupScript(), , script , , script.

script, , :

<script type="text/javascript>
    function myFunc(){
    ...
}
</script>

, , - .

script , :

<script type="text/javascript>
    doStuff();
</script>

RegisterStartupScript(), , , .

+3

Source: https://habr.com/ru/post/1710481/


All Articles