生日DROP​​DOWNLIST ASP.NET C# [英] Birthday Dropdownlist ASP.NET C#

查看:348
本文介绍了生日DROP​​DOWNLIST ASP.NET C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在生日输入,如何让我的if-else语句在一个DropDownList?

I am making an input for birthday, how do I make an if-else statement in a dropdownlist?

像月月只有28/29天它,而其余的有30个或31 ...

Months like February only have 28/29 days in it while the rest have 30 or 31...

这将是奇怪的,如果用户可以选择一个月的月和日31

It would be strange if the user can select month 'April' and day '31'

我所做正在为生日的标签..
添加另一个标签每个
'天'
'月'
和年

What I have done is making a label for 'Birthday' .. added another label for each 'day' 'month' and 'year'

和3 dropdownlists每个标签...

And 3 dropdownlists for each label...

推荐答案

您已经基本三种选择:


  1. 编写JavaScript函数中添加/删除日内将DropDownList当用户选择了一个月。

  1. Write a javascript function to add/remove days from the DropDownList when user selects a month.

设置的AutoPostBack的DropDownList的月份,并在服务器端添加/删除日内将DropDownList =真。这是要走的最简单的方法,如果你在编写JavaScript没有经验。

Set AutoPostBack="true" on the month DropDownList and on the server side add/remove days from the DropDownList. This is the easiest way to go, if you have no experience in writing javascript.

使用像jQuery日期选择器控制。

Use a control like jQuery datepicker.

这篇关于生日DROP​​DOWNLIST ASP.NET C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆