Rad选项卡OnClientTabSelected事件不应命中服务器端代码 [英] Rad tab OnClientTabSelected event should not hit server side code
问题描述
大家好,
我在页面中使用Telerik rad选项卡控件,在其中同时使用了RadTabStrip1_TabClick和OnClientTabSelected.对于一个选项卡,我必须使用服务器端代码,而对于其他选项卡,我只需要OnClientTabSelected事件,并且该事件不应触发服务器端代码,所以我的问题是,对于那些选项卡单击,我如何限制代码到达服务器端?不需要服务器端代码.
我已经用return false了,但是没用;
Hi all,
I am using Telerik rad tabs control in my page where I am using its RadTabStrip1_TabClick and OnClientTabSelected both. For one tab I have to use server side code and for others I just need the OnClientTabSelected event and it should not fire the server side code,so my question is that how I restrict the code to reach server side for those tab click where I don''t need server side code.
I have used return false but it didn''t work;
function onClientTabSelected(sender, args) {
//set tab value
var tabText = args.get_tab().get_index();
var tab = sender.get_selectedTab().get_text();
if (tab == 'Posts') {
ShowPostLinks();
return false;
//stop hitting server side code
}
if (tab == "Linkings") {
return true;
//go to server side
}
}
推荐答案
在此处提问a> [ ^ ].
尝试执行此操作以停止发回邮件.
args.set_cancel(true);
这将取消该事件.
Try this to stop post back.
args.set_cancel(true);
This will cancel the event.
这篇关于Rad选项卡OnClientTabSelected事件不应命中服务器端代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!