call jquery function when asp.net button is clicked
<script type="text/javascript">
$(document).ready(function(){
$(".btn-slide").click(function(){
$("#panel").slideToggle("fast");
$(this).toggleClass("active"); return false;
});
});
</script>
How can i call this function when an asp.net button is clicked?
Also How can I make
<a href="#" id = slidebutt开发者_如何转开发on class="btn-slide" style="color: black" shape="circle">DASHBOARD</a>
run a asp.net button when it is clicked, or update an updatepanel
Make what you want to do a normal javascript function instead. If you return false it won't post back, if you return true it will. Just keep in mind that if you put this in an update panel and you post back your toggleclass is going to get blown away probably (assuming that the button is inside the update panel and it gets re-rendered).
function btnClick() {
$("#panel").slideToggle("fast");
$(this).toggleClass("active"); return false;
}
精彩评论