首页 新闻 会员 周边

mvc Html.DropDownListFor 获取值为null

0
悬赏园豆:10 [待解决问题]

 @Html.DropDownListFor(model => model.Birthday.Year,ViewData["year"] as SelectList)
            @Html.DropDownListFor(model => model.Birthday.Month,ViewData["month"] as SelectList)
            @Html.DropDownListFor(model => model.Birthday.Date,ViewData["date"] as SelectList)

 

将日期换为下拉框DropDownListFor,页面可以显示数据库日期的值,但点保存 model中Birthday为null,不知为何,这样写法有错误?

wcxyz745的主页 wcxyz745 | 初学一级 | 园豆:192
提问于:2013-04-16 17:55
< >
分享
所有回答(1)
0

传到后台的是 year,Month,data 而不是 Birthday

iworldnd | 园豆:111 (初学一级) | 2013-04-16 21:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册