Friday, 9 September 2016

you can call javascript function from code behind using ScriptManager.

Declare required function in javascript,

<script type="text/javascript" language="javascript">
    function GetMessage() {
        alert("hello!")
    }
</script>

Write below line where you want to call Javascript function,
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "smMain", "GetMessage();", true);

No comments:

Post a Comment