日期/时间范围验证器ASP.Net

编程入门 行业动态 更新时间:2024-10-27 00:22:44
本文介绍了日期/时间范围验证器ASP.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

它看起来像标准的asp 2 RangeValidator控件不允许倍。例如01/01/2008 12时00未在我的范围接受,即使它应该是有效的。如果我删除它按预期工作的时间。

It looks like the standard asp 2 RangeValidator control doesn't allow times. e.g. 01/01/2008 12:00 is not accepted in my range, even though it should be valid. If I remove the time it works as expected.

有一个验证器,在那里,允许日期/时间格式?

Is there a validator out there that allows for date/time format?

我们没有AJAX扩展。理想情况下,想了preexisting控制或常规的前pression用的CustomValidator使用。验证应该是客户端,服务器验证部分很简单。

We don't have Ajax extensions. Ideally, would like a preexisting control or a regular expression to use with CustomValidator. Validation should be client side, the server validation part is easy.

我们用这个正则表达式:

We used this RegExp:

regexlib/REDetails.aspx?regexp_id=610

推荐答案

您可以使用自定义验证并手动进行检查。

You could use a custom validator and perform the check manually.

下面是一个简单的例子或你可以谷歌asp定制验证器。如果排除的ControlToValidate属性,那么你可以验证对多个字段。

Here's a quick example or you can Google "asp custom validator". If you exclude the "ControlToValidate" property then you can validate against multiple fields.

更多推荐

日期/时间范围验证器ASP.Net

本文发布于:2023-11-16 07:32:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1602260.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日期   时间   Net   ASP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!