用asp.net按钮点击Jquery [英] Jquery with asp.net button click
本文介绍了用asp.net按钮点击Jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在每次点击asp.net按钮时调用j查询的切换功能
所以我用这个代码
i want to call toggle function of j query on each click of asp.net button
so i used this code
$("[id*=btnAwesome]").live("click", function() {
$("#can").toggle("slow");
return false;
});
但此代码禁用我的asp按钮回发,所以我不能执行代码
i希望这样的代码有助于在每次点击时调用j查询并且还回发
but this code disable my asp buttons post back so i cant executecode behind
i want such code which help in both
calling j query on each click and also post back
推荐答案
( [id * = btnAwesome])。live( 点击,function(){
("[id*=btnAwesome]").live("click", function() {
( #can)。toggle( 慢跨度>);
return false ;
});
("#can").toggle("slow"); return false; });
但这段代码禁用了我的asp按钮回发,所以我不能执行代码
i想要这样的代码,这有助于在每次点击时调用j查询并且还回发
but this code disable my asp buttons post back so i cant executecode behind
i want such code which help in both
calling j query on each click and also post back
你使用了返回假这个东西在按钮点击后从回发停止页面。
----
试试这个例子 - (包括jquery 1.4.1)
you used Return False this thing stopping page from postback on button click.
----
try this example--(include jquery 1.4.1)
<head runat="server">
<title></title>
<script type='text/javascript' src="jquery-1.4.1.min.js">
</script>
<style type="text/css">
.panel
{
display: none;
}
</style>
<script type="text/javascript">
这篇关于用asp.net按钮点击Jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文