如何从asp:textbox texmode:date删除向上箭头键? [英] How to remove Up Down arrow keys from asp:textbox texmode:date?
本文介绍了如何从asp:textbox texmode:date删除向上箭头键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从 asp:textbox texmode:date
中删除上向下箭头键?我有带有文本模式日期的文本框,我只想要日历箭头?我怎样才能做到这一点?在图片中如何禁用标记的区域控件?
How to remove Up Down arrow keys from 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>
推荐答案
只需使用此:
<Style>
input[type=date]::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;
}
</style>
或者您可以使用日期选择器.只是
Or you can use datepicker. Just
从Web上下载 AjaxControlToolkit.dll
,将其添加到bin文件夹中,然后添加引用,然后添加
Download AjaxControlToolkit.dll
from web, add it to bin folder, then Add reference and then add
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
到您的aspx页面.样式部分
to your aspx page. 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>
您的文本框
<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"/>
它会看起来像这样.
这篇关于如何从asp:textbox texmode:date删除向上箭头键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文