asp.net FormView控件的使用方法

作者:袖梨 2022-07-02

YPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w***3.org/TR/REC-html40/loose.dtd">

YPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.**w*3.org/TR/xhtml11/DTD/xhtml11.dtd">

FormView并不是由那些杂七杂八的列所组成的。你不能给一个FormView添加BoundField或是TemplateField,不过FormView是使用模板来呈现的。我们可以这样来理解FormView,把它当作只含有一个TemplateField的DetailsView控件



Untitled Page



asp教程:SqlDataSource ID="sourceEmployees"
runat="server"
ConnectionString=""
ProviderName="System.Data.SqlClient"
SelectCommand="SELECT * FROM Employees"/>


-




, ,








File: Web.config








更复杂用法




Untitled Page




DataKeyNames="CustomerID" AllowPaging="True">

CustomerID:
ID="CustomerIDLabel1">


CompanyName:
ID="CompanyNameTextBox">

ContactName:
ID="ContactNameTextBox">

ContactTitle:
ID="ContactTitleTextBox">

Address:
ID="AddressTextBox">

City:
ID="CityTextBox">

Region:
ID="RegionTextBox">

PostalCode:
ID="PostalCodeTextBox">

Country:
ID="CountryTextBox">

Phone:
ID="PhoneTextBox">

Fax:
ID="FaxTextBox">



CommandName="update" />
CommandName="cancel" />


CustomerID: Text=''>

CompanyName: Text=''>

ContactName: Text=''>


ContactTitle: Text=''>


Text=''>

Text=''>

Text=''>

Runat="server"
Text=''>

Text=''>

Phone: Text=''>


Fax: Text=''>


Text="Edit" CommandName="edit" />


SelectCommand="SELECT * FROM [Customers]"
ConnectionString="">





File: Web.config




connectionString="Data Source=localhostSQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True"
providerName="System.Data.SqlClient" />































相关文章

精彩推荐