TabContainer实现服务器端回传

TabContainer要实现服务器端回传,出来在后台实现 OnActiveTabChanged 事件外,
还需要在前台实现 OnClientActiveTabChanged 事件,这是关键。
< asp:UpdatePanel  ID ="UpdatePanel1"  runat ="server"  ChildrenAsTriggers ="true" >
    
< contenttemplate >
        
< ajaxToolkit:TabContainer  runat ="server"  ID ="Tabs"  Height ="480px"  Width ="100%"  
            OnClientActiveTabChanged
="activeTabChanged"
            OnActiveTabChanged
="Tabs_ActiveTabChanged" >
            
< ajaxToolkit:TabPanel  runat ="Server"  ID ="Panel1"  HeaderText ="我的消息" >
                
< ContentTemplate >
                ***
                
ContentTemplate >
            
ajaxToolkit:TabPanel >
            
< ajaxToolkit:TabPanel  runat ="Server"  ID ="Panel2"  HeaderText ="已发消息" >
                
< ContentTemplate >
                    ***
                
ContentTemplate >
            
ajaxToolkit:TabPanel >
        
ajaxToolkit:TabContainer >
    
contenttemplate >
    
< triggers >
        
< asp:AsyncPostBackTrigger  ControlID ="Tabs"  EventName ="ActiveTabChanged"   />
    
triggers >
asp:UpdatePanel >

< script  language ="javascript"  type ="text/jscript" >
function activeTabChanged(sender, e) 

    __doPostBack('
<%= Tabs.ClientID %>', sender.get_activeTabIndex()); 
}

script >
文章来源于 http://www.cnblogs.com/wf225 版权归原作者所有

你可能感兴趣的:(服务器,tabs,server,javascript,asp,.NET)