如何在HTML 5日期文本框中更改禁用日期的背景颜色? [英] How do I change back color of disabled dates on HTML 5 Date Textbox?

查看:129
本文介绍了如何在HTML 5日期文本框中更改禁用日期的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下文本框:



< asp:TextBox ID =    txtDateofAccident runat =   server  BorderStyle =  宽度=    230px占位符=   123马尼拉市 type =  日期 >  < /   asp:TextBox  >  





我暂时禁用未来日期



< pre lang =c#> txtDateofAccident.Attributes [ max] = DateTime.Now.ToString( yyyy-MM-dd);





如何将其背面颜色更改为红色?

解决方案

它被称为 ControlTemplate [ ^ ]。



看看这里:

了解ASP.NET中的模板 [ ^ ]

使用ControlTemplate自定义现有控件的外观 [ ^ ]


I have the following textbox:

<asp:TextBox ID="txtDateofAccident" runat="server" BorderStyle="None" Width="230px" placeholder="123 Manila City" type="Date" ></asp:TextBox>



and I have disabled future dates

txtDateofAccident.Attributes["max"] = DateTime.Now.ToString("yyyy-MM-dd");



How Do I change Its back color to RED?

解决方案

It is called ControlTemplate[^].

Have a look here:
Understanding Templates in ASP.NET[^]
Customizing the Appearance of an Existing Control by Using a ControlTemplate[^]


这篇关于如何在HTML 5日期文本框中更改禁用日期的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆