PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/CSASPNETFormViewUpload/Default.aspx

#
ASP.NET | 112 lines | 110 code | 2 blank | 0 comment | 0 complexity | e69b9fa36b1235812b1b0b3211f16dda MD5 | raw file
  1<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CSASPNETFormViewUpload.Default" %>
  2
  3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4
  5<html xmlns="http://www.w3.org/1999/xhtml" >
  6<head runat="server">
  7    <title></title>
  8</head>
  9<body>
 10    <form id="form1" runat="server">
 11    <div>
 12        <asp:FormView ID="fvPerson" runat="server" 
 13            onitemdeleting="fvPerson_ItemDeleting" oniteminserting="fvPerson_ItemInserting" 
 14            onitemupdating="fvPerson_ItemUpdating" 
 15            onpageindexchanging="fvPerson_PageIndexChanging" 
 16            onmodechanging="fvPerson_ModeChanging">        
 17            <EditItemTemplate>
 18                <table style="width: 400px;" >
 19                    <tr>
 20                        <td style="width: 128px; height: 128px;" rowspan="2">
 21                            <asp:Image ID="imgPicture" runat="server" 
 22                            ImageUrl ='<%# Eval("PersonID","Image.aspx?PersonID={0}") %>' Width="128px" 
 23                            Height="128px" /> 
 24                        </td>
 25                        <td valign="top">
 26                            Person ID:
 27                            <asp:Label ID="lblPersonID" runat="server" Text='<%# Eval("PersonID") %>' />
 28                            <br />
 29                            First name:
 30                            <asp:TextBox ID="tbFirstName" runat="server" 
 31                            Text='<%# Bind("FirstName") %>' />
 32                            <br />
 33                            Last name:
 34                            <asp:TextBox ID="tbLastName" runat="server" 
 35                            Text='<%# Bind("LastName") %>' />
 36                            <br />                     
 37                            Picture path:
 38                            <asp:FileUpload ID="uploadPicture" runat="server" />
 39                        </td>
 40                    </tr>
 41                    <tr>
 42                        <td valign="bottom">
 43                            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
 44                            CommandName="Update" Text="Update" />
 45                            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
 46                        CausesValidation="False" CommandName="Cancel" Text="Cancel" />
 47                        </td>
 48                    </tr>
 49                </table>
 50            </EditItemTemplate>
 51            <InsertItemTemplate>
 52                <table style="width: 400px;" >
 53                    <tr>
 54                        <td height="100px" valign="top">
 55                            First name:
 56                            <asp:TextBox ID="tbFirstName" runat="server" 
 57                            Text='<%# Bind("FirstName") %>' />
 58                            <br />
 59                            Last name:
 60                            <asp:TextBox ID="tbLastName" runat="server" 
 61                            Text='<%# Bind("LastName") %>' />
 62                            <br />                     
 63                            Picture path:
 64                            <asp:FileUpload ID="uploadPicture" runat="server" />
 65                        </td>
 66                    </tr>
 67                    <tr>
 68                        <td height="28px" valign="bottom">
 69                             <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
 70                            CommandName="Insert" Text="Insert" />
 71                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
 72                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
 73                        </td>
 74                    </tr>
 75                </table>              
 76            </InsertItemTemplate>
 77            <ItemTemplate>
 78                <table style="width: 400px;">                
 79                    <tr>
 80                        <td style="width: 128px; height: 128px;" rowspan="2">
 81                            <asp:Image ID="imgPicture" runat="server" 
 82                            ImageUrl ='<%# Eval("PersonID","Image.aspx?PersonID={0}") %>' Width="128px" 
 83                            Height="128px" /> 
 84                        </td>
 85                        <td valign="top">
 86                            Person ID:
 87                            <asp:Label ID="lblPersonID" runat="server" Text='<%# Eval("PersonID") %>' />
 88                            <br />
 89                            First name:
 90                            <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
 91                            <br />
 92                            Last name:
 93                            <asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LastName") %>' />                            
 94                        </td>
 95                    </tr>
 96                    <tr>
 97                        <td valign="bottom">
 98                            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
 99                            CommandName="Edit" Text="Edit" />
100                            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
101                            CommandName="Delete" Text="Delete" />
102                            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
103                            CommandName="New" Text="New" />
104                        </td>
105                    </tr>                     
106                </table>             
107            </ItemTemplate>            
108        </asp:FormView>             
109    </div>
110    </form>
111</body>
112</html>