如何在asp.net文本框上放置默认日期格式 [英] How to put default date format on asp.net textbox
本文介绍了如何在asp.net文本框上放置默认日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在没有任何屏蔽工具的情况下将asp.net文本框上的默认日期格式设置为dd / MM / yyyy。
有人可以帮助我,我确实尝试过谷歌但从未找到我想要的东西。
Hi,
I would like to put a default date format on an asp.net textbox to dd/MM/yyyy without any masking tools.
Can someone please help me, I did try google but never found what I quite want.
推荐答案
正如评论中所建议的,jQuery将是选择你。将新的JavaScript文件添加到项目中,并将以下代码添加到其中。请务必在页面中引用它以使其工作。您还需要引用jquery-1.10.2.min.js
。
使用ID作为inDate
的控件的解释。
As suggested in the comments, jQuery will be the choice for you. Add a new JavaScript file to your project and add the following code to it. Make sure to reference it in the page for it to work. You will need a reference tojquery-1.10.2.min.js
as well.
Using the Id of the control asinDate
for explanation.
(document).ready(function(){
(document).ready(function() {
(' #inDate')。focus(function(){
var inDate =
('#inDate').focus(function () { var inDate =
这篇关于如何在asp.net文本框上放置默认日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文