zoukankan      html  css  js  c++  java
  • 关于DataList的嵌套 和(ItemCommand)事件的问题

        找到嵌套的DataList(注:因为第一行为标题,所以第一次行循环找不到DataList 所以才要判断if (DataListDepartment != null))
      protected void score_ItemDataBound(object sender, DataListItemEventArgs e)
    {
           DataList DataListDepartment = e.Item.FindControl("DataListDepartment") as DataList;
                if (DataListDepartment != null)
                {
                    DataTable DepartmentSingalInformation = new DataTable();
                    SqlDataAdapter sda = new SqlDataAdapter("Article_DepartmentSingalInformation", myConnection);
                    sda.SelectCommand.CommandType = CommandType.StoredProcedure;
                    sda.SelectCommand.Parameters.Add(new SqlParameter("@articleID", articleID));
                    sda.SelectCommand.Parameters.Add(new SqlParameter("@CreateDepartment", Convert.ToInt32(DepartmentID.Text)));
                    sda.Fill(DepartmentSingalInformation);
                    DataListDepartment.DataSource = DepartmentSingalInformation;
                    DataListDepartment.DataBind();
                }
    }

    另外在ItemCommand事件中 找到一行和gridview的区别是(GridViewRow WorkGuideGridViewRow = (GridViewRow)((Control)e.CommandSource).Parent.Parent)
            protected void score_ItemCommand(object source, DataListCommandEventArgs e)
            {
                DataListItem DataListItemRow = (DataListItem)((Control)e.CommandSource).Parent;
                Label DepartmentID = DataListItemRow.FindControl("DepartmentID") as Label;
                Label DepartmentName = DataListItemRow.FindControl("DepartmentName") as Label;
                if (e.CommandArgument == "MoreInformation")
                {
     
                }
            }

  • 相关阅读:
    classpath多个包添加
    不错的博客
    ARCGIS10.1 GeoDatabase深入理解:客户端连接与退出地理数据库时系统表的初始化
    ArcGIS Geodatabase版本控制机制的学习总结
    ARCGIS 10.1 发布服务问题以及注意事项汇总
    关于项目外包的一些总结
    ArcGIS与SuperMap的使用比较(1)
    [译]关于JavaScript 作用域你想知道的一切
    Apache 配置ArcGIS server/portal 反向代理
    arcgis server 无法手动删除切片
  • 原文地址:https://www.cnblogs.com/cuihongyu3503319/p/527188.html
Copyright © 2011-2022 走看看