gridview中调用数组来显示

                     <asp:TemplateField HeaderText="地区">
                         <ItemTemplate>
                             <asp:Label ID="Label1" runat="server" Text='<%# prolistArray[Convert.ToInt32(Eval("sf_province_id"))]%>’></asp:Label>
                         </ItemTemplate>
                         <HeaderStyle Width="80px" />
                    </asp:TemplateField> 

 

 

                     <asp:TemplateField HeaderText="地区">
                         <ItemTemplate>
                             <asp:Label ID="Label1" runat="server" Text='<%# prolistArray[Convert.ToInt32(Eval("sf_province_id"))]%>’></asp:Label>
                         </ItemTemplate>
                         <HeaderStyle Width="80px" />
                    </asp:TemplateField> 

 

在CS文件中 public string[] prolistArray = { "上海市", "北京市", "天津市"};

发表评论

电子邮件地址不会被公开。 必填项已用*标注