<script type="text/javascript">
$(function(){
ShowProduct();
$("#ShowUserInfo").click(function(){
ShowProduct();
});
}); function ShowProduct(){
if( $("#ShowUserInfo").prop("checked")){
$("#div1").show();
}else{
$("#ShowProductInfo").attr("checked",false);
$("#div1").hide();
}
}
</script>
      <div style="margin: 10px 3px;" id="div">
<label><a href="#" class="Param"><span class="glyphicon "></span></a>会员详情</label>
<input type="checkbox" style="vertical-align: middle;" value="1" <%=ShowUserInfo.Equals("1")?"checked=\"checked\"":"" %> id="ShowUserInfo" name="ShowUserInfo" />
</div>
<div style="margin: 10px 3px;" id="div1">
<label><a href="#" class="Param"><span class="glyphicon "></span></a>产品信息</label>
<input type="checkbox" style="vertical-align: middle;" value="1" <%=ShowProductInfo.Equals("1")?"checked=\"checked\"":"" %> id="ShowProductInfo" name="ShowProductInfo" />
</div>

html

checkbox  int 格式和bool格式 以及无格式的

                   <tr>
<td class="Center">
品牌类型
</td>
<td style="padding-left:20px; ">
<div style="font-size:13px;">
<input id="Brand" name="Brand" type="checkbox" value="0" <%=this.Model.Brand.ToInt() == 0?"checked=checked":"" %> />
<label for="chkBrand"><span >自主品牌</span></label>&nbsp;&nbsp;
<input id="ThirdBrand" name="ThirdBrand" type="checkbox" value="1" <%=this.CurrentModel.Brand.ToInt() == 1?"checked=checked":"" %> />
<label for="ThirdBrand"><span>合作品牌</span></label>&nbsp;&nbsp;
</div>
</td>
</tr>

public int? Brand { get; set; }

 public bool  IsBrand { get; set; }
 public bool  IsThirdBrand{ get; set; }
 public int  Brand { get; set; }
 public int  ThirdBrand { get; set; }
 单个
      <tr>
<th><span">是否激活</span></th>
<td >
<input id="IsActive" name="IsActive" type="checkbox" value="True" <%=this.Model.IsActive?"checked=checked":"" %> />
</tr>

 
        <tr>
<td class="Center">
品牌类型
</td>
<td style="padding-left:20px; ">
<div style="font-size:13px;">
<input id="Brand" name="Brand" type="checkbox" value="0" <%=this.Model.IsBrand.ToBool()?"checked=checked":"" %> />
<label for="chkBrand"><span >自主品牌</span></label>&nbsp;&nbsp;
<input id="ThirdBrand" name="ThirdBrand" type="checkbox" value="1" <%=this.Model.IsThirdBrand.ToBool()?"checked=checked":"" %> />
<label for="ThirdBrand"><span>合作品牌</span></label>&nbsp;&nbsp;
</div>
</td>
</tr>
<tr>
<td class="Center">
品牌类型
</td>
<td style="padding-left:20px; ">
<div style="font-size:13px;">
<input id="Brand" name="Brand" type="checkbox" value="0" <%=this.Model.Brand?"checked=checked":"" %> />
<label for="chkBrand"><span >自主品牌</span></label>&nbsp;&nbsp;
<input id="ThirdBrand" name="ThirdBrand" type="checkbox" value="1" <%=this.Model.ThirdBrand?"checked=checked":"" %> />
<label for="ThirdBrand"><span>合作品牌</span></label>&nbsp;&nbsp;
</div>
</td>
</tr>
       /// <summary>
/// 转换成为Bool格式
/// </summary>
/// <param name="src">输入对象</param>
/// <returns>Bool</returns>
public static bool ToBool(this object src)
{
if (src == null || src == DBNull.Value)
{
return false;
}
return src.ToString().ToUpper() == "TRUE";
} /// <summary>
/// 转换成int类型
/// </summary>
/// <param name="src">
/// </returns>
public static int ToInt(this object src)
{
var _Return = ;
if (src != null)
{
int.TryParse(src.ToString(), out _Return);
}
return _Return;
}

radio

              <tr>
<th ><span langtext="langmailtemplate">给个评价呗</span>
</th>
<td >
<img alt="" style="margin-left: 3px; margin-right: 3px;" src="/Images/haopin.png" />
<input id="Radio1" name="EvaluateType" type="radio" value="16" <%=this.Model.EvaluateType.ToInt() == 1||this.Model.EvaluateType.ToInt() == 0?"checked=checked":"" %> />
<label for="Radio1" style="font-size: 14px; height: 30px; color: #f00;">&nbsp;<span langtext="langseltype-0">大赞一个</span>&nbsp;&nbsp;&nbsp;</label>
<img alt="" style="margin-left: 3px; margin-right: 3px; width: 30px; height: 30px" src="../Images/wuxing.png" />
<input id="Radio2" name="EvaluateType" type="radio" value="2" <%=this.Model.EvaluateType.ToInt() == 2?"checked=checked":"" %> />
<label for="Radio2" style="font-size: 14px; height: 30px; color: #f00;">&nbsp;<span langtext="langseltype-1">五星好评</span>&nbsp;&nbsp;&nbsp;</label>
<img alt="" src="/Images/yanshifahuo.png" />
<input id="Radio3" name="EvaluateType" type="radio" value="3" <%=this.Model.EvaluateType.ToInt() == 3?"checked=checked":"" %> />
<label for="Radio3" style="font-size: 14px; height: 30px; color: #f00;">&nbsp;<span langtext="langseltype-2">延迟发货</span></label>
</td>
</tr>

RadioButtonList

                             <tr>
<th>
退款类型:
</th>
<td colspan="4">
<asp:RadioButtonList runat="server" ID="ddlRefund" RepeatDirection="Horizontal"
RepeatLayout="Flow">
<asp:ListItem Value="1" Selected="True">线上退款</asp:ListItem>
<asp:ListItem Value="2">线下汇款</asp:ListItem>
<asp:ListItem Value="3">帐户退款</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>

DropDownList控件的使用

                       <tr>
<th>
退款类型:
</th>
<td colspan="4">
<select id="ddlAliPayRefundType" runat="server">
<option value="0">无退款</option>
<option value="1">未发货退款</option>
<option value="2">已发货退款</option>
<option value="3">部分退款</option>
<option value="4">全额退款</option>
  <option value="5">货物丢失退款</option>
</select>
</td>
</tr>

checkbox  bool类型 和int类型的 用法

<td  style="padding-left:20px; ">
<div >
<input type="checkbox" name="IsSelfBrand" id="IsSelfBrand" value="True" <%=this.Model.IsSelfBrand.ToBool()? "checked=checked" : "" %> /><label for="chkIndependentBrand"><span langtext="langmanually">自主品牌</span></label>&nbsp;&nbsp;
<input id="IsOtherBrand" name="IsOtherBrand" type="checkbox" value="True" <%=this.Model.IsOtherBrand.ToBool()?"checked=checked":"" %> />
<label for="chkThirdPartyBrand"><span langtext="langautomatic">第三方合作品牌</span></label>&nbsp;&nbsp; <input id="chkManualModel" name="SendModel" type="checkbox" value="0" <%=this.Model.SendModel.ToInt() == 0?"checked=checked":"" %> />
<label for="chkManualModel"><span langtext="langmanually">手动档</span></label>&nbsp;&nbsp;
<input id="chkAutoModel" name="SendModel" type="checkbox" value="1" <%=this.Model.SendModel.ToInt() == 1?"checked=checked":"" %> />
<label for="chkAutoModel"><span langtext="langautomatic">自动档</span></label>&nbsp;&nbsp;</div>
</td>

用jQuery 选中复选框 控制文本框可输入状态

if ($("#IsDays").prop("checked")) {
var TextDay = $("#Days").val();
if (TextDay == "") {
window.parent.Alert("提示信息", "请输入天数!");
return false;
}
}
//控制控件是否可输入事件 $("#IsDays").click(function () {
if ($(this).prop("checked")) {
$("#Days").numberbox({ disabled: false });
} else {
$("#Days").numberbox({ disabled: true });
}
}); <input type="checkbox" name="IsDays" id="IsDays" style="vertical-align: -2px;" <%--<%=Model.IsDays ? "checked=checked" : "" %>--%> />
<span >生产天数≥&nbsp;</span>
<input type="text" class="easyui-textbox" id="Days" name="Days" style="width: 150px;" disabled="disabled" value="<%=Model.Days %>" />&nbsp;<span>天</span>

设置输入框禁用启用,可能会出现无法获取序列化值 特别在修改值的时候 无法获取到赋值信息

建议用这个

 $("#IsDays").click(function () {
if ($(this).prop("checked"))
{ $('#Days').textbox('textbox').attr('readonly', false); //建议用这个
}
else
{ $('#Days').textbox('textbox').attr('readonly', true); //建议用这个
}
});

用 disabled 可以 以下使用方式 即可控制

<%=Model!=null &&Model.Days>0 ? "" : "disabled='disabled'" %>  <%--disabled="disabled"--%>

列表绑定信息显示:

  <!--列表 开始-->
<div class="listing-list">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="datagrid-htable">
<thead class="datagrid-header">
<tr class="datagrid-header-row">
<%--<td style="width: 6%; text-align: center;">
<input onclick="$.rb_allchoose(this)" type="checkbox" />
</td>--%>
<td style="width: 8%; text-align: center;">支付订单号<a class="rb-sort" asc="id_asc" desc="id_desc"></a>
</td>
<td style="width: 12%; text-align: center;">支付类型
</td><td style="text-align: center;">支付信息内容 </td>
<td style="text-align: center;">支付会员信息 </td>
<td style="text-align: center;">支付时间 </td>
</tr>
</thead><tbody id="Tbody" class="datagrid-body">
<%
Models.ForEach(model =>
{
%>
<tr style="background-color:<%= Models.IndexOf(model) % 2 == 0 ? "#FFF" : "#EEEEFF" %>">
<td class="tdcenter"> <%=model.ID %></td>
<td class="tdcenter">
<%if (model.PayType == 1)
{%>支付宝支付<%}
else if (model.PayType == 2)
{ %>微信支付<%}
else {%> 银联支付 <%} %>
</td>
<td ><%=model.PayInfo %> </td><td class="tdcenter"><%=model.UserName %></td>
<td class="tdcenter"><%=model.AddTime %> </td>
</tr>
<%
});
%>
</tbody>
</table>
</div>
<!--列表 结束-->

开始逐步补充下相关Web知识,很多年没搞了....的更多相关文章

  1. Spring Framework------>version4.3.5.RELAESE----->Reference Documentation学习心得----->Spring Framework中web相关的知识(概述)

    Spring Framework中web相关的知识 1.概述: 参考资料:官网documentation中第22小节内容 关于spring web mvc:  spring framework中拥有自 ...

  2. ES6+Webpack 下使用 Web Worker

    大家都知道 HTML 5 新增了很多 API,其中就包括 Web Worker,在普通的 js 文件上使用 ES5 编写相关代码应该是完全没有问题了,只需要在支持 H5 的浏览器上就能跑起来. 那如果 ...

  3. Linux实战教学笔记19:Linux相关网络知识梳理

    第十九节 Linux相关网络知识梳理 标签(空格分隔): Linux实战教学笔记-陈思齐 一,前言 一个运维有时也要和网络打交道,所以具备最基本的网络知识,对一个运维人员来说是必要的.但,对于我们的工 ...

  4. JAVA相关基础知识

    JAVA相关基础知识 1.面向对象的特征有哪些方面 1.抽象: 抽象就是忽略一个主题中与当前目标无关的那些方面,以便更充分地注意与当前目标有关的方面.抽象并不打算了解全部问题,而只是选择其中的一部分, ...

  5. 羽夏看Linux内核——段相关入门知识

    写在前面   此系列是本人一个字一个字码出来的,包括示例和实验截图.如有好的建议,欢迎反馈.码字不易,如果本篇文章有帮助你的,如有闲钱,可以打赏支持我的创作.如想转载,请把我的转载信息附在文章后面,并 ...

  6. 深入理解mysql之BDB系列(1)---BDB相关基础知识

        深入理解mysql之BDB系列(1) ---BDB相关基础知识 作者:杨万富   一:BDB体系结构 1.1.BDB体系结构 BDB总体的体系结构如图1.1所看到的,包括五个子系统(见图1.1 ...

  7. windows下python web开发环境的搭建

    windows下python web开发环境: python2.7,django1.5.1,eclipse4.3.2,pydev3.4.1 一. python环境安装 https://www.pyth ...

  8. 外网主机访问虚拟机下的Web服务器_服务器应用_Linux公社-Linux系统门户网站

    body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...

  9. 【RAC】RAC相关基础知识

    [RAC]RAC相关基础知识 1.CRS简介    从Oracle 10G开始,oracle引进一套完整的集群管理解决方案—-Cluster-Ready Services,它包括集群连通性.消息和锁. ...

随机推荐

  1. 【Java】 剑指offer(51)数组中的逆序对

    本文参考自<剑指offer>一书,代码采用Java语言. 更多:<剑指Offer>Java实现合集   题目 在数组中的两个数字如果前面一个数字大于后面的数字,则这两个数字组成 ...

  2. JAXB注解 @XmlRootElement 及XML文件解析详解

    @Retention(value=RUNTIME) @Target(value=TYPE) public @interface XmlRootElement @Inherited @Retention ...

  3. [CodeVS4438]YJQ Runs Upstairs

    [CodeVS4438]YJQ Runs Upstairs 题目大意: 一个\(n(n\le50)\)个点\(m(m\le300)\)条边的DAG,保证从\(1\)到\(n\)的所有路径经过边数均小于 ...

  4. crm的知识点整理

    ''' # 1. 通过ChangeList封装好多数据 # 2. 销售中公共资源:Q查询,3天 15天 from django.db.models import F,Q F 使用查询条件的值,专门取对 ...

  5. bzoj 1076 状态压缩最优期望

    题意: 你正在玩你最喜欢的电子游戏,并且刚刚进入一个奖励关.在这个奖励关里,系统将依次随 机抛出k次宝物,每次你都可以选择吃或者不吃(必须在抛出下一个宝物之前做出选择,且现在决定不吃的宝物以后也不能再 ...

  6. eclipse如何导入jar包 BUILD PATH

    http://blog.csdn.net/believejava/article/details/41750987

  7. Docker 停止容器

    查看运行的容器 [root@node3 ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f070c6924656 ...

  8. 关于C#报空Object is null 错误的看法

    昨天项目的一个问题 :在切换场景页面的时候,报空指针的错,总显示没有找到对象.由于代码是之前就早写好的了,只是根据最上层领导的意见修改下个别显示UI,所以也就一定是后来的那些代码问题.果不其然,加的新 ...

  9. Java虚拟机的最大内存是多少

    天分析了当前比较流行的几个不同公司不同版本JVM的最大内存,得出来的结果如下: 公司 JVM版本 最大内存(兆)client 最大内存(兆)server SUN 1.5.x 1492 1520 SUN ...

  10. EasyUI学习总结(二)——easyloader分析与使用(转载)

    本文转载自:http://www.cnblogs.com/haogj/archive/2013/04/22/3036685.html 使用脚本库总要加载一大堆的样式表和脚本文件,在easyui 中,除 ...