问题描述
我有4个标签,每个标签内都有一个图像按钮但是当我每次发回第一个活动标签而不是当前标签时点击任何图像按钮
请建议我该怎么做
我尝试过的事情:
我创建了一个id为tabs的div,我在这个div中保留了标签然后我写了一个java脚本代码:
$(function(){
$(#tabs)。tabs();
//在标签更改上设置哈希值
$ ('#tabs ul li a')。click(function(){
location.hash = $(this).attr('href');
}) ;
//在帖子后面维护哈希
$('#<%= Page.Form.ClientID%>') .attr('onsubmit','this.action + = top.location.hash');
})
I have 4 tabs and inside each tab I have an Image button but when I click on any Image button every time that post back to the first active tab and not on the current tab
please advice what should i do
What I have tried:
I have created one div with id "tabs" and I kept the tabs inside this div and then I have written a java script code:
$(function () {
$("#tabs").tabs();
// set hash on tab change
$('#tabs ul li a').click(function () {
location.hash = $(this).attr('href');
});
//maintain hash on post back
$('#<%=Page.Form.ClientID%>').attr('onsubmit', 'this.action += top.location.hash');
})
这篇关于如何避免在图像按钮单击上的选项卡内回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!