Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="tabsTest2.aspx.cs" Inherits="tabsTest2" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7. <title>Untitled Page</title>
  8. </head>
  9. <body>
  10. <form id="form1" runat="server">
  11. <div>
  12.  
  13. <asp:ScriptManager ID="ScriptManager1" runat="server">
  14. </asp:ScriptManager>
  15.  
  16. </div>
  17. <asp:UpdatePanel ID="UpdatePanel1" runat="server">
  18. <ContentTemplate>
  19. <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
  20. onselectedindexchanged="DropDownList1_SelectedIndexChanged">
  21. <asp:ListItem Value="0">View 1</asp:ListItem>
  22. <asp:ListItem Value="1">View 2</asp:ListItem>
  23.  
  24. </asp:DropDownList>
  25. <asp:MultiView ID="MultiView1" runat="server">
  26. <asp:View ID="View1" runat="server">
  27. <asp:Button ID="Button1" runat="server" Text="Button" />
  28. view1
  29. </asp:View><asp:View ID="View2" runat="server">
  30. view2
  31. </asp:View>
  32. </asp:MultiView>
  33. </ContentTemplate>
  34. <Triggers>
  35. <asp:AsyncPostBackTrigger ControlID="DropDownList1" />
  36. </Triggers>
  37. </asp:UpdatePanel>
  38.  
  39.  
  40. </form>
  41. </body>
  42. </html>
  43.  
  44.  
  45.  
  46.  
  47. public partial class tabsTest2 : System.Web.UI.Page
  48. {
  49. protected void Page_Load(object sender, EventArgs e)
  50. {
  51.  
  52. }
  53. protected void DropDownList1_SelectedIndexChanged(object
  54. sender, EventArgs e)
  55. {
  56.  
  57. MultiView1.ActiveViewIndex = Convert.ToInt16(DropDownList1.SelectedValue);
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement