1. Problems not implemented at the moment:
The content in the Custom cell of the calendar control. I want to add a linkbutton-like control on each date. However, no matter how it is done, all events cannot be added. This control is dynamically generated, and a feature of the dynamically generated control is that the event must be loaded at each loading, but I failed to do so, I tried my best to add events.
I wrote a linkbutton and inherited it from the system. However, the events I added cannot be displayed on the calendar.
The book clearly states that ASP cannot be added to the cell of the calendar. . Net Control. Of course, some text or HTML is acceptable.
Now, the only feasible solution is to add HTML by yourself.CodeThe a mark is used for implementation. However, the trouble is not anything else, but its subsequent parameters and some content on the page. I'm speechless.
2. An interesting small problem:
I often use control. attribute. the add method is used to add properties similar to click for some controls. For example, if you want a control to pop up a dialog box when you click, you can use attriibute. add ("onclick", "alert ('message')"); for interesting things, we can also define some data: for example:
Attribute. Add ("thedatetime", datetime. Now. tostring ());
After that, use sender to retrieve the data in the returned event!
(Sender as linkbutton). Attribute ["thedatetime"] can retrieve this data... In this way, a good solution is provided for the above problems.
Finally, I want to solve the problem as follows:
Write a <a herf = "myfunction (this)" mydata = "mydata"> text </a>
Then process mydata in myfunction and return it to the server, which is similar to a linkbutton, but I don't know if it works! Try again .....