zoukankan      html  css  js  c++  java
  • Label显示绑定dropdownlist数据~

     <ItemTemplate>
                
    <asp:Label ID="Label1" runat="server" Text=<%# GetReportsToName(Eval("ReportsTo")) %> />
             
    </ItemTemplate>
             
    <EditItemTemplate>
                
    <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="ReportsToList"
                   DataTextField
    ="Name" DataValueField="EmployeeID" SelectedValue='<%# Bind("ReportsTo") %>'
                   Width="157px">
                
    </asp:DropDownList>
             
    </EditItemTemplate>

       public string GetReportsToName(object reportsToId)
       {
          foreach (DataRowView row in ReportsToList.Select(DataSourceSelectArguments.Empty))
          {
             if (reportsToId.Equals(row["EmployeeID"]))
             {
                return row["Name"].ToString();
             }
          }
          throw new ArgumentException("Employee with ID: "
             + reportsToId.ToString() + " does not exist.");
       }
  • 相关阅读:
    Hive安装
    hbase安装
    Spring boot 出现的时间
    RESTful Web API 实践
    Java的进阶之道
    Spring boot 注解简单备忘
    使用 xshell 登录 Windows 的 linux 子系统
    Nginx 实用配置
    跟着大彬读源码
    跟着大彬读源码
  • 原文地址:https://www.cnblogs.com/zwl12549/p/866993.html
Copyright © 2011-2022 走看看