RadioButton的check改變的時候


https://stackoverflow.com/questions/8095256/asp-net-radio-button-change

You'll need to specify the attribute and value AutoPostBack="true" in order to tell ASP.NET that changing of that element should trigger a postback.

It should be applied to each individual RadioButton which you wish to cause a postback.

 

https://stackoverflow.com/questions/5079237/problem-checking-a-radio-button-in-code-behind

在代碼中設置radiobutton的checked的屬性的時候,必須分別設置。否則會導致設置無效的問題

比如radiobutton1和radiobutton2,radiobutton1的checked屬性為false,radiobutton2的checked屬性為true。

假如在頁面設置radiobutton1的checked為true,那么radiobutton2的checked會自動變成false。

但是如果在代碼層直接設置的話,radiobutton1.checked=true;radiobutton2的checked屬性還是保持true,不會自己變化的。需要另外用代理單獨設置。因為radiobutton2的checked還是true,所以對radiobutton1的checked的設置無效

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM