01 | <%@ Page Language="C#" %> |
02 | < script language = "C#" runat = "server" > |
03 | protected void Button1_Click( object sender, EventArgs e ) { |
04 | if ( RadioButtonList1.SelectedIndex > -1 ) |
05 | Label1.Text = "You selected: " + RadioButtonList1.SelectedItem.Text; |
07 | protected void chkLayout_CheckedChanged( object sender, EventArgs e ) { |
08 | if ( chkLayout.Checked ) |
09 | RadioButtonList1.RepeatLayout = RepeatLayout.Table; |
11 | RadioButtonList1.RepeatLayout = RepeatLayout.Flow; |
13 | protected void chkDirection_CheckedChanged( object sender, EventArgs e ) { |
14 | if ( chkDirection.Checked ) |
15 | RadioButtonList1.RepeatDirection = RepeatDirection.Horizontal; |
17 | RadioButtonList1.RepeatDirection = RepeatDirection.Vertical; |
24 | < asp:RadioButtonList id = "RadioButtonList1" runat = "server" > |
25 | < asp:ListItem >Item 1</ asp:ListItem > |
26 | < asp:ListItem >Item 2</ asp:ListItem > |
27 | < asp:ListItem >Item 3</ asp:ListItem > |
28 | < asp:ListItem >Item 4</ asp:ListItem > |
29 | < asp:ListItem >Item 5</ asp:ListItem > |
30 | < asp:ListItem >Item 6</ asp:ListItem > |
31 | </ asp:RadioButtonList > |
33 | < asp:CheckBox id = "chkLayout" |
34 | OnCheckedChanged = "chkLayout_CheckedChanged" Text = "Display Table Layout" |
35 | Checked = true AutoPostBack = "true" runat = "server" /> |
36 | < asp:CheckBox id = "chkDirection" |
37 | OnCheckedChanged = "chkDirection_CheckedChanged" |
38 | Text = "Display Horizontally" AutoPostBack = "true" runat = "server" /> |
39 | < asp:Button id = "Button1" Text = "Submit" onclick = "Button1_Click" |
41 | < asp:Label id = "Label1" Font-Names = "Verdana" font-size = "8pt" |
|
|
|