简体   繁体   English

您可以在ASP.net文本框中创建“分隔符”吗? (C#)

[英]Can you make a “separator” in ASP.net Textboxes? (C#)

I was just curious if it's possible to put a "separator" (Not sure what you'd call it) in a textbox in ASP.net. 我只是好奇是否有可能在ASP.net的文本框中放置“分隔符”(不确定您会叫什么)。 For example, I want a textbox on my form to be a blank textbox with "blank:blank:blank" so they can just type the time, and another to be "blank/blank/blank" for the date, and so on. 例如,我希望表单上的文本框是带有“ blank:blank:blank”的空白文本框,以便他们可以只键入时间,而另一个则将日期键入为“ blank / blank / blank”,依此类推。 I've tried googling it for a bit but didn't find what I was looking for, probably because I'm calling it a seperator, and I'm not sure how accurate that is. 我尝试使用谷歌搜索了一下,但没有找到我想要的东西,可能是因为我称其为分隔符,而且不确定其准确性如何。 I was hoping it could be done that way, but if there's another way, I'm using C#. 我希望可以那样做,但是如果有另一种方法,我正在使用C#。 Let me know if I explained that right at all or if you can recommend anything. 让我知道是否我完全解释了这一点,或者您可以推荐任何东西。 As before, I appreciate the help from this community! 和以前一样,我感谢这个社区的帮助!

Probably should start with checking out if an input mask meets your needs. 可能应该从检查输入掩码是否满足您的需求开始。 The AJAX Control Toolkit might be a good place to start when looking at easy to use controls. 在查看易于使用的控件时,AJAX控件工具包可能是一个不错的起点。 Check out their MaskedEdit control at: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/ 在以下位置检查其MaskedEdit控件: http : //www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/

Use the MaskedEdit control in ASP.NET (from the AJAX Control Toolkit ), should do exactly what you want. 使用ASP.NET中的MaskedEdit控件(来自AJAX控件工具包 ),应完全按照您的要求进行。

HOW TO Use the MaskedEdit Control in ASP.NET 如何在ASP.NET中使用MaskedEdit控件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM