I have never liked it.. net. it is mainly because every time he clicks, the refresh will be made. with Ajax. net is also of some use. so let's take a look.
Using system; using system. data; using system. configuration; using system. web; using system. web. security; using system. web. ui; using system. web. UI. webcontrols; using system. web. UI. webcontrols. webparts; using system. web. UI. htmlcontrols; public partial class _ default: system. web. UI. page {// declare an array to place the corresponding holiday // For ease of use, the definition is 13 months, 32 days string [,] days = new string [13, 32]; protected void page_load (Object sender, eventargs E) {Days [1, 1] = "Lantern Festival";} protected void button#click (Object sender, eventargs E) {}/// <summary> /// write the dayrender event // </Summary> /// <Param name = "sender"> </param> // <param name = "E"> </param> protected void calendar#dayrender (Object sender, dayrendereventargs e) {calendarday d = E. day; // obtain the date information of the current cell. tablecell c = E. cell; // obtain the cell if (D. isothermonth) // determines whether to clear the content in the cell {C. controls. clear ();} Else {string myday = days [D. Date. Month, D. Date. Day]; If (myday! = NULL) // if there is a date ..... {c. controls. clear (); // you can clear and then add your own control button B = new button (); B. TEXT = "A"; C. controls. add (B); // For example, a button is added here. killed the original 1. orz C. controls. add (New literalcontrol ("<a Title = '" + myday + "'>★</A> "); C. forecolor = system. Drawing. color. Red; // you can add some cells }}}}
Running Effect