top button
Flag Notify
Site Registration

What's the difference between Page.RegisterClientScriptBlock and Page.RegisterStartupScript?

0 votes
217 views
What's the difference between Page.RegisterClientScriptBlock and Page.RegisterStartupScript?
posted Sep 28, 2015 by Jayshree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

RegisterClientScriptBlock is for returning blocks of client-side script containing functions. RegisterStartupScript is for returning blocks of client scripts, not packaged in functions. In other words, code that's to execute when the page is loaded. The latter positions script blocks near the end of the document so elements on the page that the script interacts with are loaded before the script runs. <%@ Reference Control="MyControl.ascx" %>

answer Sep 28, 2015 by Shivaranjini
...