[英]How to remove Up Down arrow keys from asp:textbox texmode:date?
How to remove Up Down arrow keys from asp:textbox texmode:date
? 如何从
asp:textbox texmode:date
删除向上向下箭头键? I have textbox with textmode date and I just want the calender arrow ?? 我有带有文本模式日期的文本框,我只想要日历箭头? how can I achieve this?
我该如何实现? in picture how can I disable the marked area controls??
在图片中如何禁用标记的区域控件?
<asp:TextBox Width="95%" ID="tourEndDate" runat="server" TextMode="Date" onkeypress="return false" onKeyDown="return false"></asp:TextBox></td>
Just use this: 只需使用此:
<Style>
input[type=date]::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;
}
</style>
Or you can use datepicker. 或者,您可以使用datepicker。 Just
只是
Download AjaxControlToolkit.dll
from web, add it to bin folder, then Add reference and then add 从网站下载
AjaxControlToolkit.dll
,将其添加到bin文件夹,然后添加引用,然后添加
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
to your aspx page. 到您的aspx页面。 Style Part
样式部分
<style type="text/css">
.cal_Theme1 .ajax__calendar_container {
background-color: #DEF1F4;
border:solid 1px #77D5F7;
}
.cal_Theme1 .ajax__calendar_header {
background-color: #ffffff;
margin-bottom: 4px;
}
.cal_Theme1 .ajax__calendar_title,
.cal_Theme1 .ajax__calendar_next,
.cal_Theme1 .ajax__calendar_prev {
color: #004080;
padding-top: 3px;
}
.cal_Theme1 .ajax__calendar_body {
background-color: #ffffff;
border: solid 1px #77D5F7;
}
.cal_Theme1 .ajax__calendar_dayname {
text-align:center;
font-weight:bold;
margin-bottom: 4px;
margin-top: 2px;
color: #004080;
}
</style>
Your TextBox 您的文字框
<asp:TextBox ID="txtDate" runat="server" AutoComplete="off"></asp:TextBox>
<cc1:CalendarExtender ID="ceFromDate" CssClass= " cal_Theme1" TargetControlID="txtDate" Format="dd-MMM-yyyy" runat="server"/>
It will appear like this. 它看起来像这样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.