<asp:Label ID="UserId" runat="server"></asp:Label> <asp:Label ID="UserName" runat="server" Font-Bold="true" ForeColor="#97b23c" Font-Size="14px"></asp:Label> <br /> <asp:Button ID="SelectUserBtn" runat="server" Text="Select User" /> </td> <td> <asp:Panel ID="Pnl" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <h4>List Of Available Users</h4> <asp:ListBox ID="SourceList" runat="server" DataSourceID="SqlDataSource1" DataTextField="FullName" DataValueField="UserId" Height="160" Width="200" ></asp:ListBox><br /> <asp:Button ID="OKBtn" runat="server" Text="Add User" OnClick="OkBtn_Click" /> <asp:Button ID="CancelBtn" runat="server" Text="Cancel" /><br /> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:sos_dmsConStr %>" SelectCommand="SELECT [UserId], [FullName] FROM [UserProfiles]"> </asp:SqlDataSource> </asp:Panel> <asp:ModalPopupExtender ID="MPEUserList" runat="server" TargetControlID="SelectUserBtn" PopupControlID="Pnl" OkControlID="OKBtn" BackgroundCssClass="ModalBackground" DropShadow="true" CancelControlID="CancelBtn"> </asp:ModalPopupExtender>
protected void OkBtn_Click(object sender, EventArgs e) { UserId.Text = SourceList.SelectedItem.Value; UserName.Text = SourceList.SelectedItem.Text; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)