I have an asp button. When i click this button it will be disabled. I want it to enable on a particular date of every month. How will i do? Please help. Thanks in advance.
DateTime dt = DateTime.Now; // Change "5" to the day you are interested in if (dt.Day == 5) { // enable button } else { // disable button }
page load
protected void Page_Load(object sender, EventArgs e) { int dayToEnable = 10; // 10th of every month btnID.Enabled = false; if (DateTime.Today.Day == dayToEnable) btnID.Enabled = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)