开发者

In Asp.Net, what control is more suitable for getting time (hh:mm) from user and pass it as a parameter?

In Asp.Net, what control is more suitable for getting time (hh:mm) from user and pass it as a parameter to开发者_如何学Go a query?


If you don't mind using the ASP.NET Ajax Control Toolkit, you can use the MaskedEdit control. The second example shows you how to let users enter a time-value.


I believe you have to choose between the following three:

  1. Use a TextBox and do extensive input validation.
  2. Use solution #1, but add a client side time picker on top of the TextBox.
  3. Use two DropDownList controls - one for hours, one for minutes.
  4. Use some kind of third-party time picker control.

Which one is better? I would say, that depends a lot on the expected users of your application. Anyone used to working with a keyboard is likely to prefer the TextBox. Others might prefer the other options. For the broad masses, I would most likely go for solution #2, as it should suit both keyboard and mouse centric users.

If you choose to go with a third-party control, be wary that it might not degrade gracefully for users that do not accept Javascript. The control might just revert to a simple TextBox, possibly without any validation logic.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜