<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px"
AutoGenerateRows="False" DataKeyNames="id" DataSourceID="SqlDataSource1"
EnableModelValidation="True" DefaultMode="Edit">
<Fields>
<asp:TemplateField HeaderText="Fname" SortExpression="Fname">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Fname") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Fname") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Lname" SortExpression="Lname">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Lname") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Lname") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Username" SortExpression="Username">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Username") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Username") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Password" SortExpression="Password">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Password") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("Password") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Email" SortExpression="Email">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="True" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [Table_Login]"
UpdateCommand="UPDATE [Table_Login] SET [Fname] = @Fname, [Lname] = @Lname, [Username] = @Username, [Password] = @Password, [Email] = @Email WHERE [id] = @id">
<UpdateParameters>
<asp:ControlParameter Name="Fname" ControlID="DetailsView1$TextBox1" Type="String" />
<asp:ControlParameter Name="Lname" ControlID="DetailsView1$TextBox2" Type="String" />
<asp:ControlParameter Name="Username" ControlID="DetailsView1$TextBox3" Type="String" />
<asp:ControlParameter Name="Password" ControlID="DetailsView1$TextBox4" Type="String" />
<asp:ControlParameter Name="Email" ControlID="DetailsView1$TextBox5" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
No comments:
Post a Comment