开发者

Conditional logic depens on culture settings. ASP.NET

I have bunch pages and I need to validate data there. If culture for example "es-ES" I should use one validatio开发者_Python百科n logic, if culture "en-US" than another validation logic. For example I need validate phone number. Minimum length is 11 digits. For other culture 9 digits. How can I do this? Some patterns or other decisions?


If localizing, you should be using satellite assemblies for localization - this will also allow you to set culture specific RegEx expressions for validation (phone number formats etc).


You can determine the current culture by checking Thread.CurrentThread.CurrentCulture.Name. Is that what you mean?


What if my browser is set to en-US because I'm a us national but I'm in spain with a spanish mobile number?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜