【问题标题】:How to custom 'Type' in Compare Validator in ASP.Net如何在 ASP.Net 的比较验证器中自定义“类型”
【发布时间】:2010-10-19 11:07:22
【问题描述】:

如何在 ASP.Net 中重置比较验证器的日期类型 我正在为文本框的日历扩展器使用 dd/MM/yyyy 格式,其中比较验证器查找 MM/dd/YYYY 格式。 那么如何更改比较验证器的日期格式。

【问题讨论】:

    标签: asp.net ajax validation


    【解决方案1】:

    您可以通过更改页面的CultureInfo(或Web.Config 中的整个应用程序)来更改DateFormat。这在 aspx-page 的 page 指令或代码隐藏中是可能的。 查看 MSDN 了解更多信息:How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization

    例如(MM/dd/YYYY 是美国文化,不是吗?):

    <%@ Page UICulture="en-us" Culture="en-US" %>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-07-12
      • 1970-01-01
      • 2017-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-03
      相关资源
      最近更新 更多