How to call JavaScript function button click asp net

{0 Comments}

As per our requirement we have to call a java script function on the button click. For this we use traditional JavaScript calling procedure. This will be called on button click event, so the snippets for the code are as follows. 

 C# |  copy code |? 
1
protected void server_btn_Click(object sender, EventArgs e)
2
    {
3
        System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "script", "your_javascript_function_name()", true);
4
    }

Leave a Comment

Your email address will not be published.