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在什么情况下你希望它被调用?你可能忘了避开双引号