zoukankan      html  css  js  c++  java
  • .net中单选按钮RadioButton,RadioButtonList 以及纯Html中radio的用法实例?

    http://www.cnblogs.com/summers/archive/2013/07/31/3227234.html

    .net中单选按钮RadioButton,RadioButtonList 以及纯Html中radio的用法,区别?


    RadioButton实例及说明:

    <asp:RadioButton ID="publicHas" Checked="true" runat="server" CssClass="radioMiddle" Text="所有人可见" GroupName="mm"/>

    <asp:RadioButton ID="privateHas" runat="server" CssClass="radioMiddle" Text="仅自己可见" GroupName="mm" />

    <asp:RadioButton ID="friendHas" runat="server" CssClass="radioMiddle" Text="仅好友可见" GroupName="mm" />

    .net后台处理方式:
    if (privateHas.Checked == true)
    model.Limits = 0;
    if (friendHas.Checked == true)
    model.Limits = 1;
    if (publicHas.Checked == true)
    model.Limits = 2;


    RadioButtonList在.net中跟DropDownList用法相似,可以看成集合:
    <asp:RadioButtonList ID="rbImg" Name="rbImg" runat="server" RepeatDirection="Horizontal"
    RepeatLayout="Flow">
    <asp:ListItem Value="1">是</asp:ListItem>
    <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
    </asp:RadioButtonList>


    .net后台处理方式:

    this.radCid.SelectedValue = project.Cid;


    radio
    将name设置为相同的值
    <input type="radio" name="sex" value="1" checked="checked"></input>男
    <input type="radio" name="sex" value="0" ></input>女


    .net后台处理方式:
    通过Request.Form["sex"].ToString();获取

  • 相关阅读:
    GIT基本概念和用法总结
    SELECT联动
    PHP无级分类续及搜索功能,分组分页
    PHP管理员登陆、验证与添加(前端验证)
    PHP手写cms 缓存Cache
    将本地文件上传到Ftp上的一些操作【转】
    SQL对时间的处理
    SQL Server游标的使用【转】
    修改数据表字段长度
    Web.Config加密【转】
  • 原文地址:https://www.cnblogs.com/zkwarrior/p/5138474.html
Copyright © 2011-2022 走看看