日期:2014-05-17 浏览次数:20934 次
<body> <form id="form1" runat="server"> <div style="height: 428px"> <asp:GridView ID="grdAuthority" runat="server" BackColor="White" DataSourceID="srcAuthority" AutoGenerateEditButton="true" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" AutoGenerateColumns="False" onrowdatabound="grdAuthority_RowDataBound"> <RowStyle ForeColor="#000066" /> <Columns> <asp:BoundField DataField="user_id" HeaderText="User_ID" /> <asp:TemplateField HeaderText="Authority"> <ItemTemplate> <asp:DropDownList ID="authority" DataSourceID="srcDdl" DataTextField="belong" DataValueField="authority" AutoPostBack="true" Width="100" runat="server"> </asp:DropDownList> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="belong" HeaderText="Belong" /> </Columns> <FooterStyle BackColor="White" ForeColor="#000066" /> <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> </asp:GridView> <asp:ObjectDataSource ID="srcAuthority" TypeName="SPR_Web.Models.Authority" SelectMethod="getUserInfoData" UpdateMethod="UpdateAuthority" runat="server"> <UpdateParameters> <asp:Parameter Name="user_id" /> <asp:Parameter Name="authority" Type="String"/> </UpdateParameters> </asp:ObjectDataSource> <asp:ObjectDataSource ID="srcDdl" UpdateMethod="UpdateAuthority1" TypeName="SPR_Web.Models.Authority" SelectMethod="getAuthorityData" runat="server"> </asp:ObjectDataSource> <p> <input type="submit" value="Create" /> </p> </div> </form> </body>