This document is only used to record the lessons learned from this project and will not be used for other purposes.
1. The biggest problem encountered in this project was client verification. In the past few days, the tester almost drove me crazy. So I decided to develop several verification frameworks, mainly jquery. valicate. js and jdoon's jquery. formvalicateor. js. It is recommended that you select formvalicateor from maodong, mainly jquery. valicate. js is hard to control the display label of the error prompt style or custom error information. I don't know if anyone in the garden knows this. I will continue to study this framework. For the formvalicateor of maodong, basically, all the verifications can be implemented, but one of them is to write a bunch of js Code on the page, while jquery. valicate. javascript only needs to write a css = "Verification type. I will continue to study the comparison of the specific framework over the past few days, and may write an article for comparison.
2. This project is generated by nettiers. A problem occurs mainly in the pagination of the generated view, such as VList <V_OperationLog_UserInfo> vList = BLL. provider. operationLogProvider. viewGetPaged (StrWhere, "CreateTime asc", (pagerForListBottom. currentPageIndex-1) * pagerForListBottom. pageSize, pagerForListBottom. pageSize, out outCount );
Previously (pagerForListBottom. CurrentPageIndex-1) * pagerForListBottom. PageSize is directly pagerForListBottom. CurrentPageIndex-1, but if this happens this time, only one data record is displayed. It is said that this nettiers is a bug, but the previous project is also generated by nettiers. You only need to write pagerForListBottom. CurrentPageIndex-1. I don't know why, but I still need to study it carefully.
3. Bind DropDownList to the Repeater to sort the list. When the DropDownList value changes, the entire list is displayed in the new order. The OnItemDataBound of Repeater is used to bind various DropDownList values. When the DropDownList value changes, the OnSelectedIndexChanged event of the corresponding DropDownList. Remember the modified object. Here I use labal to remember the modified Object id, client code:
Code
1 <asp: Repeater ID = "RptRoleList" runat = "server" OnItemDataBound = "RptRoleList_OnItemDataBound">
2 <ItemTemplate>
3 <tr>
4 <td>
5 <asp: DropDownList ID = "DdlSort" runat = "server" AutoPostBack = "true" OnSelectedIndexChanged = "Rpt_DdlSort_OnSelectedIndexChanged"> </asp: DropDownList> <asp: label ID = "LabId" runat = "server" Visible = "false" Text = '<% # Eval ("TopCategoryId") %>'> </asp: Label>
6 </td>
7 </tr>
8 </ItemTemplate>
9 </asp: Repeater>
Background Program:
Code
1 Rpt_DdlSort_OnSelectedIndexChanged (object sender, EventArgs e)
2 {
3 DropDownList ddlSort = (DropDownList) sender;
4
5 int newvalue = ConvertHelper. GetInteger (ddlSort. SelectedItem. Text );
6 int keyid = 0; // id of the object to be modified
7 RepeaterItem item = (DropDownList) sender). Parent as RepeaterItem; // convert it to the Item
8 if (item! = Null)
9 {
10 Label LabFId = item. FindControl ("LabId") as Label; // search
11 keyid = ConvertHelper. GetInteger (LabFId. Text );
12}
13}
14
15