2017-09-13 57 views
0

我想顯示 - : - 到 - : - 在文本框在我的網頁timeband並讓用戶輸入以hh:MM-HH :mm格式(在ASP.Net Web窗體(c#)中)。要顯示 - : - 在文本框中進入時間

有沒有可能這樣做?要做到這一點,添加MaskedTextBox中爲您的應用

+0

[格式化MVC模式,時間跨度場(可能的重複https://stackoverflow.com/questions/17571291/formatting-mvc-模型的時間跨度場) –

+0

我試過,但它不工作對我來說,這就是爲什麼我張貼的問題。 –

+0

然後請給我們例子的代碼,並描述你遇到的問題。 –

回答

0

的最佳方式。如果你需要進一步驗證,你可以使用正則表達式。

0

使用掩蓋這一點。下面的電話號碼代碼,您可以更改時間格式,請參閱下面的鏈接。

<asp:MaskedEditExtender ID="mskSuperPhone" runat="server" 
        TargetControlID="txtSuperPhone" 
        ClearMaskOnLostFocus ="false" 
        MaskType="None" 
        Mask="(999)999-9999" 
        MessageValidatorTip="true" 
        InputDirection="LeftToRight" 
        ErrorTooltipEnabled="True"> 
    </asp:MaskedEditExtender> 

Mask Textbox view for a phone number

http://digitalbush.com/projects/masked-input-plugin/

http://www.c-sharpcorner.com/uploadfile/mahesh/maskedtextbox-in-C-Sharp/

檢查與搜索文本 「MaskType =時間 - 空濛版字符將被填充當前時間」 這個鏈接

http://ajaxtutorials.com/asp-net/ajax-control-toolkit-masked-edit-tutorial-example-in-asp-net-c/

相關問題