2011-05-06 63 views
0

我已經點擊單選按鈕1禁用文本框。單選按鈕2單擊如何解決我的錯誤

文本框啓用,但首先我必須點擊無線按鈕2,然後我必須單擊單選按鈕1不禁用文本框如何解決這個問題 enter code here

public partial class WebForm1 : System.Web.UI.Page 
    { 
     protected void Page_Load(object sender, EventArgs e) 
     { 
      if (!IsPostBack) 
      { 
       txtrb.Enabled = true; 
      } 

     } 


    protected void RadioButton1_CheckedChanged(object sender, EventArgs e) 
    { 
     { 
      if (RadioButton1.Enabled == true) 
      { 
       txtrb.Enabled = false ; 
      } 

     } 
    } 

    protected void RadioButton2_CheckedChanged(object sender, EventArgs e) 
    { 
     if (RadioButton2.Enabled == true) 
     { 
      txtrb.Enabled = true ; 
     } 


    } 
} 

}

+0

請寫清楚你的問題,我們不明白你想要什麼。編輯你的問題。 – 2011-05-06 04:52:24

回答

0

我認爲你必須檢查

如果(RadioButton1。檢查 ==真),如果(RadioButton2。檢查 == true)