开发者

How to Add Radio Buttons to a Form Vertically?

开发者 https://www.devze.com 2023-02-03 08:27 出处:网络
I am dynamically creating rad开发者_开发知识库io button within code behind in ASP.Net, how do I add the controls so they appear vertically instead of horizontally?RadioButtonList rbl = new RadioButton

I am dynamically creating rad开发者_开发知识库io button within code behind in ASP.Net, how do I add the controls so they appear vertically instead of horizontally?


RadioButtonList rbl = new RadioButtonList();
rbl.RepeatDirection = RepeatDirection.Vertical;


You can use RadioButtonList Control with RepeatDirection set to Vertical.
If that is not possible then....

Add them to a ordered list(OL element) or an unordered list(UL).


Possible two ways:

  • Give some CSS class, and in your css give that class some style like

    display:block;

  • Use RadioButtonList control as container to those radio buttons. Set the "RepeatDirection" property to "Vertical".

0

精彩评论

暂无评论...
验证码 换一张
取 消