项目结束,总结一下[分享]

    此文仅用于记录下此项目的经验教训,不做他用。
  1、这次项目碰到的最大的问题是客户端验证;那几天测试人员几乎把我逼疯了,所以后来狠下决心专研了几个验证框架,主要有jquery.valicate.js和猫冬的jquery.formvalicateor.js。经过最好筛选,选择了猫冬的formvalicateor,主要是jquery.valicate.js 不好控制错误提示样式或者说不能自定义错误信息的显示标签,这点我不知道园子里的人知道有没有,我会继续研究这个框架的,对于猫冬的formvalicateor,基本能实现所有的验证,但他有一点那就是在页面中要写大堆的js代码,而jquery.valicate.js 只需要写个css="验证类型"就行了。具体的这个框架的比较这几天我会继续研究,可能会写篇文章做比较。
      2、这次项目用的是nettiers 生成的。主要在生成的视图的分页出现了问题,如:    VList<V_OperationLog_UserInfo> vList = BLL.Provider.OperationLogProvider.ViewGetPaged(StrWhere, "CreateTime asc", (pagerForListBottom.CurrentPageIndex - 1) * pagerForListBottom.PageSize, pagerForListBottom.PageSize, out outCount);
以前(pagerForListBottom.CurrentPageIndex - 1) * pagerForListBottom.PageSize这句直接就是pagerForListBottom.CurrentPageIndex - 1,但这次如果这样的话就会翻一页就只翻一条数据。据说这个nettiers一个bug,但以前的项目也是nettiers生成的,就只需写pagerForListBottom.CurrentPageIndex - 1。不知道什么原因,还需要去细研究。
      3、Repeater 内绑定DropDownList,用于列表排序, 当DropDownList 值改变,这个整个列表按照新的排序显示。 主要用到了Repeater 的OnItemDataBound,绑定DropDownList的各项值。 当DropDownList 值改变时,相应DropDownList 的OnSelectedIndexChanged事件。这个还要注意,要记住修改的那个对象,我这里用了个labal来记住修改的对象id,客户端代码:
                              
ContractedBlock.gif ExpandedBlockStart.gif 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>
 后台程序:

ContractedBlock.gif ExpandedBlockStart.gif 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
 7             RepeaterItem item = ((DropDownList)sender).Parent as RepeaterItem; //转为所在Item
 8             if(item!=null)
 9             {
10                 Label LabFId = item.FindControl("LabId"as Label;  //查找
11                 keyid = ConvertHelper.GetInteger(LabFId.Text);
12             }
13 }
14 
15 
                       

转载于:https://www.cnblogs.com/yaunion/archive/2009/09/28/1575790.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值