Call any JS Function from code in ASP.NET C#

Hi.....today ill share  how to call any js function from code in asp.

Sample js code:

 <script type="text/javascript">
  function success() {
            PNotify.prototype.options.styling = "bootstrap3";
            PNotify.prototype.options.styling = "jqueryui";
            PNotify.prototype.options.styling = "fontawesome";
            new PNotify({
                title: 'INFORMATION',
                type: 'info',
                text: 'Item Retrieved Successfully.',
                after_init: function (notice) {
                notice.attention('bounce');
                }
            });
}
</script> 

on your .cs code.

  ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "success();", true);

just copy the code and change the function name and paste it on onClick or page load events of your page.

done..!Thank you. Enjoy Coding....and smoking. :)


Comments

Popular posts from this blog

How to show multiple markers on Google maps from database in ASP.Net

How to Solve Bootstrap Tooltip disappearing inside a updatepanel control when a button is click or in postback in ASP.NET

Show Bootstrap Popup Modal from inside a Repeater in Asp.Net