html.TextBox() 需要绑定个PlanBeginTime的字段。怎么写啊 时间控件有 Class="Wdate" onfocus="WdatePicker()" 2个属性。

解决方案 »

  1.   

    Html.TextBox("name", "value", new { @class = "wdate", onfocus = "WdatePicker()" })
      

  2.   

    我的 字段值是这种形式:   t => t.PlanBeginTime 给html.TextBox 赋值的。那要怎么写啊?
      

  3.   

    那就用 Html.TextBoxFor(t => t.PlanBeginTime, null, new { @class = "wdate", onfocus = "WdatePicker()" })那些扩展方法大多有好几个重载,看看就知道了。
      

  4.   

    上面写多了个参数Html.TextBoxFor(t => t.PlanBeginTime, new { @class = "wdate", onfocus = "WdatePicker()" })
      

  5.   

    可是 这样写 有报错 "TextBoxFor方法没有任何重载采用3个参数"!
      

  6.   

    还有个问题是: 用   Html.TextBoxFor(t => t.PlanBeginTime, new { @class = "wdate", onfocus = "WdatePicker()" }) 时做 添加功能 保存不了 数据 这是为什么呀?
      

  7.   

    还有个问题是: 用 Html.TextBoxFor(t => t.PlanBeginTime, new { @class = "wdate", onfocus = "WdatePicker()" }) 时做 添加功能 保存不了 数据 这是为什么呀?
      

  8.   

    用 MY97 时间控件 选择时间后 保存 提示:  SqlDateTime 溢出。必须介于 1/1/1753 12:00:00 AM 和 12/31/9999 11:59:59 PM 之间。
      

  9.   

    ??? 我有 提交到 Controller.cs 里头啊 有保存呀 而且 就时间字段保存不了 其他的 比如标题 都能保存。
      

  10.   

    用 Html.TextBoxFor(t => t.PlanBeginTime, new { @class = "wdate", onfocus = "WdatePicker()" }) 时做 添加功能 保存不了 数据 这是为什么呀?   
      

  11.   

    我知道了 是以为我还有 2个时间字段 没有赋值 然后就报错了 呵呵 谢谢各位的帮忙 特别是 KarasCanvas 。