TabContainer控件用法

http://blog.csdn.net/vipxiaotian/article/details/1748663



1. 在设计图上
添加一个 TabContainer 控件 , 两个 UpdatePanel, UpdatePanel 里加入 Label Button
2, 在添加  TabPanel 控件时 , 在设计图中是添加不上去的 , 需要在           
  <cc1:TabContainer ID="TabContainer1" runat="server" Width ="260px" Height ="150px">
                <ContentTemplate>
                                       //TabPanel 代码
                </ContentTemplate>// 记得加入这个否则会出错

 </cc1:TabPanel>
 
Default.aspx
<% @ Page Language ="C#" AutoEventWireup ="true" CodeFile ="Default.aspx.cs" Inherits ="_Default" %>
 
<% @ Register Assembly ="AjaxControlToolkit" Namespace ="AjaxControlToolkit" TagPrefix ="cc1" %>
 
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
< html xmlns ="http://www.w3.org/1999/xhtml">
< head runat ="server">
     < title > Untitled Page </ title >
</ head >
< body style ="">
     < form id ="form1" runat ="server">
         < asp : ScriptManager ID ="ScriptManager1" runat ="server" />
         < div >
             < cc1 : TabContainer ID ="TabContainer1" runat ="server" Width ="260px" Height ="150px">
           
                 < cc1 : TabPanel ID ="TabPanel1" runat ="server" HeaderText ="Tabe1">
                 < ContentTemplate >
                      < asp : UpdatePanel ID ="UpdatePanel1" runat ="server">
                         < ContentTemplate >
                             < asp : Label ID ="Label1" runat ="server" Text ="Label"></ asp : Label >< br />
                                  < br />
                                      < asp : Button ID ="btnOK" runat ="server" OnClick ="btnOK_Click" Text =" 确定" />
                                 </ ContentTemplate >
                             </ asp : UpdatePanel >
                 </ ContentTemplate >
                 </ cc1 : TabPanel >
               
               
                 < cc1 : TabPanel ID ="TabPanel2" runat ="server" HeaderText ="Tabe2">
                     < ContentTemplate >
                          < asp : UpdatePanel ID ="UpdatePanel2" runat ="server">
                                 < ContentTemplate >
                                     < asp : Label ID ="Label2" runat ="server" Text ="Labe2"></ asp : Label >< br />
                                     < br />
                                     < asp : Button ID ="Button1" runat ="server" OnClick ="Button1_Click" Text =" 确定" />
                                 </ ContentTemplate >
                           </ asp : UpdatePanel >
                     </ ContentTemplate >
                 </ cc1 : TabPanel >
               
               
                 < cc1 : TabPanel ID ="TabPanel3" runat ="server" HeaderText ="Tabe3">
                 < ContentTemplate >
                     < br />< br /> 这是我第一个Tabs < br />< br />
                    < a href =   http://blog.csdn.net/meng1986> meng </ a >
                 </ ContentTemplate >
               
                 </ cc1 : TabPanel >
             </ cc1 : TabContainer ></ div >
      
       
     </ form >
</ body >
</ html >
 
 
 
 
Default.aspx.cs
 
public partial class _Default  : System.Web.UI. Page
{
     protected void  Page_Load( object  sender,  EventArgs  e)
    {
 
    }
     protected void  btnOK_Click( object  sender,  EventArgs  e)
    {
         this .Label1.Text = " 这是Tab1" ;
    }
     protected void  Button1_Click( object  sender,  EventArgs  e)
    {
         this .Label2.Text=" 这是Tabl2" ;
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值