1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="KeyEdit.aspx.cs" Inherits="KeyEdit" %>
<%@ Reference Page="~/KeyView.aspx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:UpdatePanel ID="updVwKey" runat="server">
<ContentTemplate>
<asp:LinkButton ID="btReturnToUsersList" runat="server" CausesValidation="false" Font-Bold="true" Text="Return to users list" PostBackUrl="~/KeyView.aspx" /><br />
<br />
<asp:Label ID="lblTitle" runat="server" ForeColor="#0155aa" Font-Underline="true">Key detail:</asp:Label>
<asp:DetailsView ID="vwKey" runat="server" DataSourceID="odsKey" DataKeyNames="Key" AutoGenerateRows="False" OnItemCommand="vwKey_ItemCommand">
<Fields>
<asp:TemplateField HeaderText="Key">
<EditItemTemplate>
<asp:Label ID="lblKey" runat="server" Text='<%# Bind("Key") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblKey" runat="server" Text='<%# Bind("Key") %>'></asp:Label>
</ItemTemplate>
<ControlStyle Width="120px" />
<HeaderStyle Width="100px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Email">
<EditItemTemplate>
<asp:Label ID="lblEmail" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblEmail" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
</ItemTemplate>
<ControlStyle Width="300px" />
<ItemStyle Width="300px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Ip">
<EditItemTemplate>
<asp:Label ID="lblIp" runat="server" Text='<%# Bind("Ip") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblIp" runat="server" Text='<%# Bind("Ip") %>'></asp:Label>
</ItemTemplate>
<ControlStyle Width="300px" />
<ItemStyle Width="300px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Created on" InsertVisible="False">
<EditItemTemplate>
<asp:Label ID="lblCreated" runat="server" Text='<%# Eval("CreationDate", "{0:dd/MM/yyyy HH:mm:ss}") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblCreated" runat="server" Text='<%# Eval("CreationDate", "{0:dd/MM/yyyy HH:mm:ss}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Expirate on" InsertVisible="False">
<EditItemTemplate>
<asp:TextBox ID="txtExpirationDate" runat="server" Text='<%# Bind("ExpirationDate", "{0:dd/MM/yyyy HH:mm:ss}") %>' MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="valrqExpirationDate" runat="server" ControlToValidate="txtExpirationDate" Text="*" Display="Dynamic" ValidationGroup="valKeyGroup" Font-Bold="true" ForeColor="#CC0000" SetFocusOnError="True" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblCreated" runat="server" Text='<%# Eval("ExpirationDate", "{0:dd/MM/yyyy HH:mm:ss}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="First Name">
<EditItemTemplate>
<asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>' MaxLength="1000"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblFirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:Label>
</ItemTemplate>
<ControlStyle Width="300px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Last Name">
<EditItemTemplate>
<asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>' MaxLength="1000"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
</ItemTemplate>
<ControlStyle Width="300px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="State" ControlStyle-Width="80px">
<EditItemTemplate>
<asp:DropDownList ID="lstState" runat="server" SelectedValue='<%# Bind("Status") %>'>
<asp:ListItem Text="OK" />
<asp:ListItem Text="NOK" />
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblState" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
</ItemTemplate>
<ControlStyle Width="80px" />
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="btUpdate" runat="server" CausesValidation="True" ValidationGroup="valKeyGroup" CommandName="Update" Text="Update"></asp:LinkButton>
<asp:LinkButton ID="btCancelUpdate" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="btEdit" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Fields>
</asp:DetailsView>
<asp:ValidationSummary ID="valKey" runat="server" ShowMessageBox="False" ShowSummary="True" ValidationGroup="valKeyGroup" Font-Bold="true" ForeColor="#CC0000" />
<asp:Label ID="lblSelectedValue" runat="server" Visible="false" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:ObjectDataSource ID="odsKey" runat="server" TypeName="XXX.XXXKey" DataObjectTypeName="XXX.XXXKey" SelectMethod="GetKey"
UpdateMethod="Update">
<SelectParameters>
<asp:ControlParameter ControlID="lblSelectedValue" DbType="string" Name="Key" PropertyName="Text" />
</SelectParameters>
</asp:ObjectDataSource>
</asp:Content> |
Partager