<table> <tr> <td> <asp:Button ID="bt1" runat="server" Text="Tab 1" BorderStyle="None" CssClass="Initial" OnClick="bt1_Click" /> <asp:Button ID="bt2" runat="server" Text="Tab 2" BorderStyle="None" CssClass="Initial" OnClick="bt2_Click" /> <asp:MultiView ID="mainView" runat="server"> <asp:View ID="View1" runat="server"> <table style="width: 100%; border-width: 1px; border-color: #666; border-style: solid"> <tr><td> <h3><span>View 1 </span></h3> </td></tr> </table> </asp:View> <asp:View ID="View2" runat="server"> <table style="width: 100%; border-width: 1px; border-color: #666; border-style: solid"> <tr><td><h3><span>View 2 </span></h3> </td></tr> </table> </asp:View> </asp:MultiView></td></tr></table>
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { bt1.CssClass = "Clicked"; mainView.ActiveViewIndex = 0; } } protected void bt1_Click(object sender, EventArgs e) { bt1.CssClass = "Clicked"; bt1.CssClass = "Initial"; bt3.CssClass = "Initial"; mainView.ActiveViewIndex = 0; } protected void bt2_Click(object sender, EventArgs e) { bt1.CssClass = "Initial"; bt2.CssClass = "Clicked"; bt3.CssClass = "Initial"; mainView.ActiveViewIndex = 1; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)