How to call Jquery function from C#

后端 未结 3 546
萌比男神i
萌比男神i 2020-12-19 13:23

I would like to fadein and out a div after performing some code. This JQuery function is working fine when using the button\'s onclientclick property. But, Unable to call it

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-19 13:42

    C#

    protected void btn_click(object sender, Eventargs e)
    {
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "Confirm();", true);
    }
    

    JS:

    
    

    Edit Improve Code

    C#

    protected void btn_click(object sender, Eventargs e)
    {
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "Confirm();", true);
    }
    

    JS:

    
    

提交回复
热议问题