Ext.net中ComboBox如何绑定数据库中的值
Ext.net中ComboBox如何绑定数据库中的值
<ext:ComboBox ID="ComBox_SecretsLevel" runat="server" FieldLabel="密级" Width="250" EmptyText="请选择密级..." > <Items> <ext:ListItem Text="公开" Value="1"/> <ext:ListItem Text="保密" Value="2" /> <ext:ListItem Text="绝密" Value="3" /> </Items> </ext:ComboBox> |
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LR_FileReg.aspx.cs" Inherits="EasyCreate.DFMS.WebUI.LR_FileReg" %> <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>绑定Combobox后台数据</title> </head> <body> <form id="form1" runat="server"> <ext:ResourceManager ID="ResourceManager1" runat="server"/> <ext:Store ID="Store_SecretsCom" runat="server"> <Reader> <ext:JsonReader> <Fields> <ext:RecordField Name="SecretsLevelID" Type="Int"/> <ext:RecordField Name="SecretsLevelName" Type="String" /> </Fields> </ext:JsonReader> </Reader> </ext:Store> <ext:ComboBox ID="ComBox_SecretsLevel" runat="server" FieldLabel="密级" Width="250" EmptyText="请选择密级..." StoreID="Store_SecretsCom" ValueField="SecretsLevelID" DisplayField="SecretsLevelName"> </ext:ComboBox> </form> </body> </html> |
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。