Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在asp.net代码中调用类单击函数_Javascript_Asp.net - Fatal编程技术网

Javascript 在asp.net代码中调用类单击函数

Javascript 在asp.net代码中调用类单击函数,javascript,asp.net,Javascript,Asp.net,我有一个功能 $(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',

我有一个功能

$(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
      });

 }); });
我想从asp.net中的代码隐藏中调用它 请告诉我怎么做。 提前谢谢

你可以这样试试

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

}
protectedvoidbtnclick(对象发送方,事件参数e)
{
ScriptManager.RegisterStartupScript(this.Page,this.Page.GetType(),“id”,
“$('.tstInfo')。单击();”,true);
}

查看中的
$.ajax
,您想何时调用它?加载时?@Eddi=
$ajax
在您希望从客户端调用到服务器,但从服务器调用到客户端时非常有用it@hardkoded在什么情况下你希望它被调用?你可能忘了避开双引号