-->
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowFormView.aspx.cs" Inherits="LearnAsp.Net.ControlDemo.DataBound.ShowFormView" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Show FormView</title> </head> <body> <form id="form1" runat="server"> <div> <asp:FormView ID="FormView1" DataKeyNames="employee_id" DataSourceID="srcEmployees" BackColor="#cbe0c5" BorderColor="Black" DefaultMode="Edit" AllowPaging="true" runat="server"> <EditItemTemplate> <asp:Label ID="lblEmployeeName" Text="Employee Name:" AssociatedControlID="txtName" runat="server" /> <asp:TextBox ID="txtName" Text='<%#Bind("first_name")%>' runat="server" /> <br /> <asp:Label ID="lblhiredate" Text="Hire Date:" AssociatedControlID="txthiredate" runat="server" /> <asp:TextBox ID="txthiredate" Text='<%#Bind("hire_date", "{0:dd-MMM-yyyy}")%>' runat="server" /> <br /> <asp:Button ID="btnUpdate" Text="Update" CommandName="Update" runat="server" /> </EditItemTemplate> </asp:FormView> <asp:SqlDataSource ID='srcEmployees' ConnectionString="<%$ ConnectionStrings:constrOracle %>" ProviderName="System.Data.OracleClient" SelectCommand=" select employee_id,first_name ,hire_date from employees " UpdateCommand='UPDATE employees SET first_name=:first_name, hire_date=:hire_date WHERE employee_id=:employee_id' runat='server' /> </div> </form> </body> </html>
Thanks for reading Asp.Net Two-Way DataBinding Expressions
Please do not enter any spam link in the comment box.
No comments:
Post a Comment
Please do not enter any spam link in the comment box.