简体   繁体   English

如何从asp:textbox texmode:date删除向上向下箭头键?

[英]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.

相关问题 如何禁用向上和向下箭头键 - How to disable up and down arrow keys 寻找一个由向上和向下箭头键操作的日期小部件以增加日期 - Looking for a date widget operated by up and down arrow keys to increment date 如何使用箭头键在ASP.NET gridview中导航(向上或向下)? - How to navigate (up or down) in ASP.NET gridview using arrow keys? 如何使用箭头键在ASP.NET Gridview中上下移动 - How to Move up and down in ASP.NET Gridview Using Arrow Keys 如何使用箭头键从一个文本框导航到另一个文本框 - How to navigate from one textbox to another textbox using arrow keys 如何将向上和向下箭头键映射到向上和向下键 - How do I map up and down-arrow keys to page-up and page-down keys 在玩游戏时,如何阻止我的网站通过箭头键上下滚动? - How do I stop my website from scrolling up and down with the arrow keys when playing games? Angular:使用方向键上下导航时,如何防止滚动条移动? - Angular: How can I prevent the scrollbar from moving when navigating with the arrow keys up and down? 如何在引导程序下拉列表中启用向上和向下箭头键 - How to enable up and down arrow keys in bootstrap dropdown 如何使用箭头键上下滚动引导程序模式 - How to scroll a bootstrap modal with arrow keys up - down
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM