Many parts of the project need to upload and download files, display the file name, upload time basic information, while providing bulk deletion and download function.
For convenience, a control was made, using the Ajax effect. The design is a bit cumbersome.
Overall effect:
Attachment record Attachment List
Data display controls
1, encapsulates the basic data method, is completely the foreground method. For example, the Get,post,delete method.
2. Provides a container (DIV) for displaying data.
Two variables _title and _id are defined in the background due to the need to specify a header and container Id.
WebForm uses an MVC-like writing style on the Ascx page. <%%>
Data generation controls
Implemented through the Repeater control.
The bridge between the two controls is ashx. The data that is requested by Ajax is automatically mapped to the control by reflection.
So, when you use it, you only need to refer to the first control.
System constant adjustment, maintenance feel very tired. Why is this happening?
It should be added that the actual presentation is a little more complicated. The display is effective.
For example, a div display title, click the title to control the visibility of the div that displays the data. Data, that is, attachments, can be uploaded, downloaded, deleted. Control visibility based on permissions.
Develop a more flexible custom control