简体   繁体   English

在asp.net代码后面调用类单击功能

[英]call on class click function in asp.net code behind

I have a function! 我有功能!

$(document).ready(function() {
  $(".tstInfo").on("click",function(){
       $.toast({
        heading: 'Welcome to my Elite admin',
        text: 'Use the predefined ones, or specify a custom position object.',
        position: 'top-right',
        loaderBg:'#ff6849',
        icon: 'info',
        hideAfter: 3000, 
        stack: 6
      });

 }); });

I want to call it from code behind in asp.net please tell me how to do it. 我想从asp.net后面的代码中调用它,请告诉我该怎么做。 Thanks in advance 提前致谢

you can try like this 你可以这样尝试

protected void BtnClick(object sender, EventArgs e)
{
  ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "id", 
      "<script language='javascript'> $('.tstInfo').click();</script>", true);            

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM