2014-05-02 43 views
-1

我想根據在RadioButtonList中關閉單選按鈕來顯示文本框,但是沒有改變顯示。對RadioButtonList沒有反應

protected void Page_Load(object sender, EventArgs e) 
{ 
} 

protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) 
{ 
    switch (RadioButtonList1.SelectedIndex) 
    { 
     case 2: 
      TextBox3.Visible = true; 
      goto case 1; 
     case 1: 
      TextBox2.Visible = true; 
      goto case 0; 
     case 0: 
      TextBox1.Visible = true; 
      goto default; 
     default: 
      break; 
    } 
} 
+0

你使用的goto語句的目的是什麼? –

回答

0

檢查並設置AutoPostBack =「True」。