DetailsView DetailsView DetailsView DetailsView Class

定义

在表中显示来自数据源的单条记录的值,其中每个数据行表示该记录的一个字段。Displays the values of a single record from a data source in a table, where each data row represents a field of the record. 使用 DetailsView 控件可以编辑、删除和插入记录。The DetailsView control allows you to edit, delete, and insert records.

public ref class DetailsView : System::Web::UI::WebControls::CompositeDataBoundControl, System::Web::UI::ICallbackEventHandler, System::Web::UI::IDataItemContainer, System::Web::UI::IPostBackEventHandler, System::Web::UI::WebControls::ICallbackContainer, System::Web::UI::WebControls::IDataBoundItemControl, System::Web::UI::WebControls::IFieldControl, System::Web::UI::WebControls::IPostBackContainer
[System.Web.UI.ControlValueProperty("SelectedValue")]
public class DetailsView : System.Web.UI.WebControls.CompositeDataBoundControl, System.Web.UI.ICallbackEventHandler, System.Web.UI.IDataItemContainer, System.Web.UI.IPostBackEventHandler, System.Web.UI.WebControls.ICallbackContainer, System.Web.UI.WebControls.IDataBoundItemControl, System.Web.UI.WebControls.IFieldControl, System.Web.UI.WebControls.IPostBackContainer
type DetailsView = class
    inherit CompositeDataBoundControl
    interface IDataItemContainer
    interface INamingContainer
    interface ICallbackContainer
    interface ICallbackEventHandler
    interface IPostBackEventHandler
    interface IPostBackContainer
    interface IDataBoundItemControl
    interface IDataBoundControl
    interface IFieldControl
Public Class DetailsView
Inherits CompositeDataBoundControl
Implements ICallbackContainer, ICallbackEventHandler, IDataBoundItemControl, IDataItemContainer, IFieldControl, IPostBackContainer, IPostBackEventHandler
继承
属性
实现

示例

下面的代码示例演示如何使用用于DetailsView控制结合GridView一个简单的母版-详细信息方案的控件。The following code example demonstrates how to use to use a DetailsView control in combination with a GridView control for a simple master-detail scenario. 它显示中选择的项的详细信息GridView控件。It displays the details of an item selected in the GridView control.

<%@ Page Language="C#" %>

<!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>ASP.NET Example</title>
</head>
<body>
  <form id="form1" runat="server">
    <div>
      <table>
        <tr>
          <td>
            <asp:GridView ID="GridView1" runat="server" 
              AutoGenerateColumns="False" DataSourceID="Customers"
              DataKeyNames="CustomerID">
              <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
                <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
              </Columns>
            </asp:GridView>
          </td>
          <td valign="top">
            <asp:DetailsView ID="DetailsView1" runat="server" 
              AutoGenerateRows="True" DataKeyNames="CustomerID"
              DataSourceID="Details" Height="50px" Width="301px">
            </asp:DetailsView>
          </td>
        </tr>
      </table>
      &nbsp;&nbsp;
      <asp:SqlDataSource ID="Details" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT * FROM [Customers] WHERE ([CustomerID] = @CustomerID)">
        <SelectParameters>
          <asp:ControlParameter ControlID="GridView1" Name="CustomerID" 
            PropertyName="SelectedValue"
            Type="String" />
        </SelectParameters>
      </asp:SqlDataSource>
      <asp:SqlDataSource ID="Customers" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT [CompanyName], [ContactName], [CustomerID] FROM [Customers]">
      </asp:SqlDataSource>
    </div>
  </form>
</body>
</html>
<%@ Page Language="VB" %>

<!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>ASP.NET Example</title>
</head>
<body>
  <form id="form1" runat="server">
    <div>
      <table>
        <tr>
          <td>
            <asp:GridView ID="GridView1" runat="server" 
              AutoGenerateColumns="False" DataSourceID="Customers"
              DataKeyNames="CustomerID">
              <Columns>
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
                <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
              </Columns>
            </asp:GridView>
          </td>
          <td valign="top">
            <asp:DetailsView ID="DetailsView1" runat="server" 
              AutoGenerateRows="True" DataKeyNames="CustomerID"
              DataSourceID="Details" Height="50px" Width="301px">
            </asp:DetailsView>
          </td>
        </tr>
      </table>
      &nbsp;&nbsp;
      <asp:SqlDataSource ID="Details" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT * FROM [Customers] WHERE ([CustomerID] = @CustomerID)">
        <SelectParameters>
          <asp:ControlParameter ControlID="GridView1" Name="CustomerID" 
            PropertyName="SelectedValue"
            Type="String" />
        </SelectParameters>
      </asp:SqlDataSource>
      <asp:SqlDataSource ID="Customers" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT [CompanyName], [ContactName], [CustomerID] FROM [Customers]">
      </asp:SqlDataSource>
    </div>
  </form>
</body>
</html>

下面的代码示例演示如何使用DetailsView控件来添加、 删除和编辑记录。The following code example demonstrates how to use the DetailsView control to add, delete, and edit records.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  void CustomerDetail_ItemInserted(object sender, 
    DetailsViewInsertedEventArgs e)
  {
    // Refresh the GridView control after a new record is inserted 
    // in the DetailsView control.
    CustomersView.DataBind();
  }

  void CustomerDetail_ItemInserting(object sender, 
    DetailsViewInsertEventArgs e)
  {
    // Iterate though the values entered by the user and HTML encode 
    // the values. This helps prevent malicious values from being 
    // stored in the data source.
    for (int i = 0; i < e.Values.Count; i++)
    {
      if (e.Values[i] != null)
      {
        e.Values[i] = Server.HtmlEncode(e.Values[i].ToString());
      }
    }
  }

  void CustomerDetail_ItemUpdated(object sender, 
    DetailsViewUpdatedEventArgs e)
  {
    // Refresh the GridView control after a new record is updated 
    // in the DetailsView control.
    CustomersView.DataBind();
  }

  void CustomerDetail_ItemUpdating(object sender, 
    DetailsViewUpdateEventArgs e)
  {
    // Iterate though the values entered by the user and HTML encode 
    // the values. This helps prevent malicious values from being 
    // stored in the data source.
    for (int i = 0; i < e.NewValues.Count; i++)
    {
      if (e.NewValues[i] != null)
      {
        e.NewValues[i] = Server.HtmlEncode(e.NewValues[i].ToString());
      }
    }
  }

  void CustomerDetail_ItemDeleted(object sender, 
    DetailsViewDeletedEventArgs e)
  {
    // Refresh the GridView control after a new record is updated 
    // in the DetailsView control.
    CustomersView.DataBind();
  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>
      DetailsView Example</title>
</head>
<body>
  <form id="Form1" runat="server">
    <h3>
      DetailsView Example</h3>
    <table cellspacing="10">
      <tr>
        <td>
          <!-- Use a GridView control in combination with      -->
          <!-- a DetailsView control to display master-detail  -->
          <!-- information. When the user selects a store from -->
          <!-- GridView control, the customers//s detailed     -->
          <!-- information is displayed in the DetailsView     -->
          <!-- control.                                        -->
          <asp:GridView ID="CustomersView" DataSourceID="Customers" 
            AutoGenerateColumns="False"
            DataKeyNames="CustomerID" runat="server">
            <HeaderStyle BackColor="Blue" ForeColor="White" />
            <Columns>
              <asp:CommandField ShowSelectButton="True" />
              <asp:BoundField DataField="ContactName" 
                HeaderText="ContactName" />
              <asp:BoundField DataField="CompanyName" 
                HeaderText="CompanyName" />
            </Columns>
          </asp:GridView>
        </td>
        <td valign="top">
          <asp:DetailsView ID="CustomerDetail" 
            DataSourceID="Details" AutoGenerateRows="false"
            AutoGenerateInsertButton="true" 
            AutoGenerateEditButton="true" 
            AutoGenerateDeleteButton="true"
            EmptyDataText="No records." 
            DataKeyNames="CustomerID" GridLines="Both" 
            OnItemInserted="CustomerDetail_ItemInserted"
            OnItemInserting="CustomerDetail_ItemInserting" 
            OnItemUpdated="CustomerDetail_ItemUpdated"
            OnItemUpdating="CustomerDetail_ItemUpdating" 
            OnItemDeleted="CustomerDetail_ItemDeleted"
            runat="server">
            <HeaderStyle BackColor="Navy" ForeColor="White" />
            <RowStyle BackColor="White" />
            <AlternatingRowStyle BackColor="LightGray" />
            <EditRowStyle BackColor="LightCyan" />
            <Fields>
              <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" />
              <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
              <asp:BoundField DataField="ContactTitle" HeaderText="ContactTitle" />
              <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
              <asp:BoundField DataField="Address" HeaderText="Address" />
              <asp:BoundField DataField="City" HeaderText="City" />
              <asp:BoundField DataField="Region" HeaderText="Region" />
              <asp:BoundField DataField="PostalCode" HeaderText="PostalCode" />
              <asp:BoundField DataField="Country" HeaderText="Country" />
              <asp:BoundField DataField="Phone" HeaderText="Phone" />
              <asp:BoundField DataField="Fax" HeaderText="Fax" />
            </Fields>
          </asp:DetailsView>
        </td>
      </tr>
    </table>
    <!-- This example uses Microsoft SQL Server and connects -->
    <!-- to the Northwind sample database.                   -->
    <!-- It is strongly recommended that each data-bound     -->
    <!-- control uses a separate data source control.        -->
    <asp:SqlDataSource ID="Customers" runat="server" 
      ConnectionString=
        "<%$ ConnectionStrings:NorthwindConnectionString %>"
      SelectCommand="SELECT [CompanyName], [ContactName], [CustomerID] 
        FROM [Customers]">
    </asp:SqlDataSource>
    <!-- Add a filter to the data source control for the     -->
    <!-- DetailsView control to display the details of the   -->
    <!-- store selected in the GridView control.             -->
    <asp:SqlDataSource ID="Details" 
      ConnectionString=
        "<%$ ConnectionStrings:NorthwindConnectionString %>"
      runat="server" 
      SelectCommand="SELECT * FROM [Customers] 
        WHERE ([CustomerID] = @CustomerID)"
      DeleteCommand="DELETE FROM [Customers] 
        WHERE [CustomerID] = @CustomerID"
      InsertCommand="INSERT INTO [Customers] ([CustomerID], 
        [CompanyName], [ContactName], [ContactTitle], [Address], 
        [City], [Region], [PostalCode], [Country], [Phone], [Fax]) 
        VALUES (@CustomerID, @CompanyName, @ContactName, @ContactTitle, 
        @Address, @City, @Region, @PostalCode, @Country, @Phone, @Fax)"
      UpdateCommand="UPDATE [Customers] SET [CompanyName] = @CompanyName, 
        [ContactName] = @ContactName, [ContactTitle] = @ContactTitle, 
        [Address] = @Address, [City] = @City, [Region] = @Region, 
        [PostalCode] = @PostalCode, [Country] = @Country, 
        [Phone] = @Phone, [Fax] = @Fax 
        WHERE [CustomerID] = @CustomerID">
      <SelectParameters>
        <asp:ControlParameter ControlID="CustomersView" 
          Name="CustomerID" PropertyName="SelectedValue"
          Type="String" />
      </SelectParameters>
      <DeleteParameters>
        <asp:Parameter Name="CustomerID" Type="String" />
      </DeleteParameters>
      <UpdateParameters>
        <asp:Parameter Name="CompanyName" Type="String" />
        <asp:Parameter Name="ContactName" Type="String" />
        <asp:Parameter Name="ContactTitle" Type="String" />
        <asp:Parameter Name="Address" Type="String" />
        <asp:Parameter Name="City" Type="String" />
        <asp:Parameter Name="Region" Type="String" />
        <asp:Parameter Name="PostalCode" Type="String" />
        <asp:Parameter Name="Country" Type="String" />
        <asp:Parameter Name="Phone" Type="String" />
        <asp:Parameter Name="Fax" Type="String" />
        <asp:Parameter Name="CustomerID" Type="String" />
      </UpdateParameters>
      <InsertParameters>
        <asp:Parameter Name="CustomerID" Type="String" />
        <asp:Parameter Name="CompanyName" Type="String" />
        <asp:Parameter Name="ContactName" Type="String" />
        <asp:Parameter Name="ContactTitle" Type="String" />
        <asp:Parameter Name="Address" Type="String" />
        <asp:Parameter Name="City" Type="String" />
        <asp:Parameter Name="Region" Type="String" />
        <asp:Parameter Name="PostalCode" Type="String" />
        <asp:Parameter Name="Country" Type="String" />
        <asp:Parameter Name="Phone" Type="String" />
        <asp:Parameter Name="Fax" Type="String" />
      </InsertParameters>
    </asp:SqlDataSource>
  </form>
</body>
</html>
<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
  Sub CustomerDetail_ItemInserted(ByVal sender As Object, _
    ByVal e As DetailsViewInsertedEventArgs)
    ' Refresh the GridView control after a new record is inserted in 
    ' the DetailsView control.
    CustomersView.DataBind()
  End Sub
  
  Sub CustomerDetail_ItemInserting(ByVal sender As Object, _
    ByVal e As DetailsViewInsertEventArgs)
    ' Iterate though the values entered by the user and HTML encode 
    ' the values. This helps prevent malicious values from being 
    ' stored in the data source.
    For i As Integer = 0 To e.Values.Count - 1
      If e.Values(i) IsNot Nothing Then
        e.Values(i) = Server.HtmlEncode(e.Values(i).ToString())
      End If
    Next
  End Sub
  
  Sub CustomerDetail_ItemUpdated(ByVal sender As Object, _
    ByVal e As DetailsViewUpdatedEventArgs)
    ' Refresh the GridView control after a new record is updated 
    ' in the DetailsView control.
    CustomersView.DataBind()
  End Sub
  
  Sub CustomerDetail_ItemUpdating(ByVal sender As Object, _
    ByVal e As DetailsViewUpdateEventArgs)
    ' Iterate though the values entered by the user and HTML encode 
    ' the values. This helps prevent malicious values from being 
    ' stored in the data source.
    For i As Integer = 0 To e.NewValues.Count - 1
      If e.NewValues(i) IsNot Nothing Then
        e.NewValues(i) = Server.HtmlEncode(e.NewValues(i).ToString())
      End If
    Next
  End Sub
  
  Sub CustomerDetail_ItemDeleted(ByVal sender As Object, _
    ByVal e As DetailsViewDeletedEventArgs)
    ' Refresh the GridView control after a new record is updated 
    ' in the DetailsView control.
    CustomersView.DataBind()
  End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>DetailsView Example</title>
</head>
<body>
  <form id="Form1" runat="server">
    <h3>DetailsView Example</h3>
    <table cellspacing="10">
      <tr>
        <td>
          <!-- Use a GridView control in combination with      -->
          <!-- a DetailsView control to display master-detail  -->
          <!-- information. When the user selects a store from -->
          <!-- GridView control, the customers's detailed      -->
          <!-- information is displayed in the DetailsView     -->
          <!-- control.                                        -->
          <asp:GridView ID="CustomersView" DataSourceID="Customers" 
            AutoGenerateColumns="False"
            DataKeyNames="CustomerID" runat="server">
            <HeaderStyle BackColor="Blue" ForeColor="White" />
            <Columns>
              <asp:CommandField ShowSelectButton="True" />
              <asp:BoundField DataField="ContactName" 
                HeaderText="ContactName" />
              <asp:BoundField DataField="CompanyName" 
                HeaderText="CompanyName" />
            </Columns>
          </asp:GridView>
        </td>
        <td valign="top">
          <asp:DetailsView ID="CustomerDetail" DataSourceID="Details" 
            AutoGenerateRows="false"
            AutoGenerateInsertButton="true" 
            AutoGenerateEditButton="true" 
            AutoGenerateDeleteButton="true"
            EmptyDataText="No records." 
            DataKeyNames="CustomerID" GridLines="Both" 
            OnItemInserted="CustomerDetail_ItemInserted"
            OnItemInserting="CustomerDetail_ItemInserting" 
            OnItemUpdated="CustomerDetail_ItemUpdated"
            OnItemUpdating="CustomerDetail_ItemUpdating" 
            OnItemDeleted="CustomerDetail_ItemDeleted"
            runat="server">
            <HeaderStyle BackColor="Navy" ForeColor="White" />
            <RowStyle BackColor="White" />
            <AlternatingRowStyle BackColor="LightGray" />
            <EditRowStyle BackColor="LightCyan" />
            <Fields>
              <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" 
                ReadOnly="True" />
              <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
              <asp:BoundField DataField="ContactTitle" HeaderText="ContactTitle" />
              <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
              <asp:BoundField DataField="Address" HeaderText="Address" />
              <asp:BoundField DataField="City" HeaderText="City" />
              <asp:BoundField DataField="Region" HeaderText="Region" />
              <asp:BoundField DataField="PostalCode" HeaderText="PostalCode" />
              <asp:BoundField DataField="Country" HeaderText="Country" />
              <asp:BoundField DataField="Phone" HeaderText="Phone" />
              <asp:BoundField DataField="Fax" HeaderText="Fax" />
            </Fields>
          </asp:DetailsView>
        </td>
      </tr>
    </table>
    <!-- This example uses Microsoft SQL Server and connects -->
    <!-- to the Northwind sample database.                   -->
    <!-- It is strongly recommended that each data-bound     -->
    <!-- control uses a separate data source control.        -->
    <asp:SqlDataSource ID="Customers" runat="server" 
      ConnectionString=
        "<%$ ConnectionStrings:NorthwindConnectionString %>"
      SelectCommand="SELECT [CompanyName], [ContactName], [CustomerID] 
        FROM [Customers]">
    </asp:SqlDataSource>
    <!-- Add a filter to the data source control for the     -->
    <!-- DetailsView control to display the details of the   -->
    <!-- store selected in the GridView control.             -->
    <asp:SqlDataSource ID="Details" 
      ConnectionString=
        "<%$ ConnectionStrings:NorthwindConnectionString %>"
      runat="server" 
      SelectCommand="SELECT * FROM [Customers] 
        WHERE ([CustomerID] = @CustomerID)"
      DeleteCommand="DELETE FROM [Customers] 
        WHERE [CustomerID] = @CustomerID"
      InsertCommand="INSERT INTO [Customers] ([CustomerID], 
        [CompanyName], [ContactName], [ContactTitle], [Address], 
        [City], [Region], [PostalCode], [Country], [Phone], [Fax]) 
        VALUES (@CustomerID, @CompanyName, @ContactName, 
        @ContactTitle, @Address, @City, @Region, @PostalCode, 
        @Country, @Phone, @Fax)"
      UpdateCommand="UPDATE [Customers] SET 
        [CompanyName] = @CompanyName, 
        [ContactName] = @ContactName, [ContactTitle] = @ContactTitle, 
        [Address] = @Address, [City] = @City, [Region] = @Region, 
        [PostalCode] = @PostalCode, [Country] = @Country, 
        [Phone] = @Phone, [Fax] = @Fax 
        WHERE [CustomerID] = @CustomerID">
      <SelectParameters>
        <asp:ControlParameter ControlID="CustomersView" 
          Name="CustomerID" PropertyName="SelectedValue"
          Type="String" />
      </SelectParameters>
      <DeleteParameters>
        <asp:Parameter Name="CustomerID" Type="String" />
      </DeleteParameters>
      <UpdateParameters>
        <asp:Parameter Name="CompanyName" Type="String" />
        <asp:Parameter Name="ContactName" Type="String" />
        <asp:Parameter Name="ContactTitle" Type="String" />
        <asp:Parameter Name="Address" Type="String" />
        <asp:Parameter Name="City" Type="String" />
        <asp:Parameter Name="Region" Type="String" />
        <asp:Parameter Name="PostalCode" Type="String" />
        <asp:Parameter Name="Country" Type="String" />
        <asp:Parameter Name="Phone" Type="String" />
        <asp:Parameter Name="Fax" Type="String" />
        <asp:Parameter Name="CustomerID" Type="String" />
      </UpdateParameters>
      <InsertParameters>
        <asp:Parameter Name="CustomerID" Type="String" />
        <asp:Parameter Name="CompanyName" Type="String" />
        <asp:Parameter Name="ContactName" Type="String" />
        <asp:Parameter Name="ContactTitle" Type="String" />
        <asp:Parameter Name="Address" Type="String" />
        <asp:Parameter Name="City" Type="String" />
        <asp:Parameter Name="Region" Type="String" />
        <asp:Parameter Name="PostalCode" Type="String" />
        <asp:Parameter Name="Country" Type="String" />
        <asp:Parameter Name="Phone" Type="String" />
        <asp:Parameter Name="Fax" Type="String" />
      </InsertParameters>
    </asp:SqlDataSource>
  </form>
</body>
</html>

下面的代码示例演示如何以声明方式添加到的行字段DetailsView控件。The following code example demonstrates how to declaratively add row fields to the DetailsView control.

<%@ Page Language="C#" %>

<!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>ASP.NET Example</title>
</head>
<body>
  <form id="Form1" runat="server">
    <table cellspacing="10">
      <tr>
        <td>
          <!-- Use a GridView control in combination with      -->
          <!-- a DetailsView control to display master-detail  -->
          <!-- information. When the user selects a store from -->
          <!-- GridView control, the store's detailed          -->
          <!-- information is displayed in the DetailsView     -->
          <!-- control.                                        -->
          <asp:GridView ID="GridView1" runat="server" 
            DataSourceID="Customers" AutoGenerateColumns="False" 
            DataKeyNames="CustomerID">
            <Columns>
              <asp:CommandField ShowSelectButton="True" />
              <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
              <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
            </Columns>
          </asp:GridView>
        </td>
        <td valign="top">
          <asp:DetailsView ID="DetailsView" runat="server"
            DataSourceID="Details" AutoGenerateRows="false"
            DataKeyNames="CustomerID" >
            <HeaderStyle BackColor="Navy" ForeColor="White" />
            <Fields>
              <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" 
                ReadOnly="True" />
              <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
              <asp:BoundField DataField="ContactTitle" HeaderText="ContactTitle" />
              <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
              <asp:BoundField DataField="City" HeaderText="City" />
              <asp:BoundField DataField="Region" HeaderText="Region" />
              <asp:BoundField DataField="PostalCode" HeaderText="PostalCode" />
              <asp:BoundField DataField="Country" HeaderText="Country" />
            </Fields>
          </asp:DetailsView>
        </td>
      </tr>
    </table>
    <!-- This example uses Microsoft SQL Server and connects -->
    <!-- to the Northwind sample database.                        -->
    <!-- It is strongly recommended that each data-bound     -->
    <!-- control uses a separate data source control.        -->
    <asp:SqlDataSource ID="Customers" runat="server" 
      ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
      SelectCommand="SELECT [CompanyName], [ContactName], [CustomerID] FROM [Customers]">
    </asp:SqlDataSource>
    <!-- Add a filter to the data source control for the     -->
    <!-- DetailsView control to display the details of the   -->
    <!-- store selected in the GridView control.             -->
    <asp:SqlDataSource ID="Details" runat="server" 
      ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
      SelectCommand="SELECT * FROM [Customers] WHERE ([CustomerID] = @CustomerID)">
      <SelectParameters>
        <asp:ControlParameter ControlID="GridView1" Name="CustomerID" 
          PropertyName="SelectedValue"
          Type="String" />
      </SelectParameters>
    </asp:SqlDataSource>
  </form>
</body>
</html>
<%@ Page Language="VB" %>

<!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>ASP.NET Example</title>
</head>
<body>
  <form id="Form1" runat="server">
    <table cellspacing="10">
      <tr>
        <td>
          <!-- Use a GridView control in combination with      -->
          <!-- a DetailsView control to display master-detail  -->
          <!-- information. When the user selects a store from -->
          <!-- GridView control, the store's detailed          -->
          <!-- information is displayed in the DetailsView     -->
          <!-- control.                                        -->
          <asp:GridView ID="GridView1" runat="server" 
            DataSourceID="Customers" AutoGenerateColumns="False" 
            DataKeyNames="CustomerID">
            <Columns>
              <asp:CommandField ShowSelectButton="True" />
              <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
              <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
            </Columns>
          </asp:GridView>
        </td>
        <td valign="top">
          <asp:DetailsView ID="DetailsView" runat="server"
            DataSourceID="Details" AutoGenerateRows="false"
            DataKeyNames="CustomerID" >
            <HeaderStyle BackColor="Navy" ForeColor="White" />
            <Fields>
              <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" 
                ReadOnly="True" />
              <asp:BoundField DataField="ContactName" HeaderText="ContactName" />
              <asp:BoundField DataField="ContactTitle" HeaderText="ContactTitle" />
              <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />
              <asp:BoundField DataField="City" HeaderText="City" />
              <asp:BoundField DataField="Region" HeaderText="Region" />
              <asp:BoundField DataField="PostalCode" HeaderText="PostalCode" />
              <asp:BoundField DataField="Country" HeaderText="Country" />
            </Fields>
          </asp:DetailsView>
        </td>
      </tr>
    </table>
    <!-- This example uses Microsoft SQL Server and connects -->
    <!-- to the Northwind sample database.                        -->
    <!-- It is strongly recommended that each data-bound     -->
    <!-- control uses a separate data source control.        -->
    <asp:SqlDataSource ID="Customers" runat="server" 
      ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
      SelectCommand="SELECT [CompanyName], [ContactName], [CustomerID] FROM [Customers]">
    </asp:SqlDataSource>
    <!-- Add a filter to the data source control for the     -->
    <!-- DetailsView control to display the details of the   -->
    <!-- store selected in the GridView control.             -->
    <asp:SqlDataSource ID="Details" runat="server" 
      ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
      SelectCommand="SELECT * FROM [Customers] WHERE ([CustomerID] = @CustomerID)">
      <SelectParameters>
        <asp:ControlParameter ControlID="GridView1" Name="CustomerID" 
          PropertyName="SelectedValue"
          Type="String" />
      </SelectParameters>
    </asp:SqlDataSource>
  </form>
</body>
</html>

注解

本主题内容:In this topic:

介绍Introduction

DetailsView控件用于在表中,显示来自数据源的单个记录的记录的每个字段的表的行中的显示位置。The DetailsView control is used to display a single record from a data source in a table, where each field of the record is displayed in a row of the table. 它可以结合使用GridView母版-详细信息方案的控件。It can be used in combination with a GridView control for master-detail scenarios. DetailsView控件支持以下功能:The DetailsView control supports the following features:

  • 绑定到数据源控件,如SqlDataSourceBinding to data source controls, such as SqlDataSource.

  • 内置插入功能。Built-in inserting capabilities.

  • 内置的更新和删除功能。Built-in updating and deleting capabilities.

  • 内置的分页功能。Built-in paging capabilities.

  • 以编程方式访问DetailsView对象模型,以便动态设置属性,处理事件,以及其他操作。Programmatic access to the DetailsView object model to dynamically set properties, handle events, and so on.

  • 通过主题和样式的自定义外观。Customizable appearance through themes and styles.

行字段Row Fields

在每个数据行DetailsView通过声明一字段控件创建控件。Each data row in the DetailsView control is created by declaring a field control. 不同的行字段类型确定在控件中的行的行为。Different row field types determine the behavior of the rows in the control. 字段控件派生自DataControlFieldField controls derive from DataControlField. 下表列出了可以使用不同的行字段类型。The following table lists the different row field types that can be used.

列字段类型Column field type 描述Description
BoundField 数据源中字段的值显示为文本。Displays the value of a field in a data source as text.
ButtonField 显示在一个命令按钮DetailsView控件。Displays a command button in the DetailsView control. 这样,您可以显示具有自定义按钮控件,例如添加或删除按钮的行。This allows you to display a row with a custom button control, such as an Add or a Remove button.
CheckBoxField 显示一个复选框在DetailsView控件。Displays a check box in the DetailsView control. 此行字段类型通常用于显示具有一个布尔值的字段。This row field type is commonly used to display fields with a Boolean value.
CommandField 显示内置命令按钮以执行编辑、 插入或删除操作DetailsView控件。Displays built-in command buttons to perform edit, insert, or delete operations in the DetailsView control.
HyperLinkField 数据源中字段的值显示为超链接。Displays the value of a field in a data source as a hyperlink. 此行字段类型,可将第二个字段绑定到超链接的 URL。This row field type allows you to bind a second field to the hyperlink's URL.
ImageField 中显示图像DetailsView控件。Displays an image in the DetailsView control.
TemplateField 显示用户定义的内容中的行DetailsView根据指定的模板的控件。Displays user-defined content for a row in the DetailsView control according to a specified template. 此行字段类型,可创建自定义行字段。This row field type allows you to create a custom row field.

默认情况下AutoGenerateRows属性设置为true,该数据源中自动生成的绑定的行字段对象的每个字段的可绑定的类型。By default, the AutoGenerateRows property is set to true, which automatically generates a bound row field object for each field of a bindable type in the data source. 有效的可绑定类型是StringDateTimeDecimalGuid,和的基元类型的集合。Valid bindable types are String, DateTime, Decimal, Guid, and the set of primitive types. 然后将每个字段显示在一行中为文本,在每个字段在数据源中的显示的顺序。Each field is then displayed in a row as text, in the order in which each field appears in the data source.

自动生成行提供快速而简单的方式来显示记录中的每个字段。Automatically generating the rows provides a quick and easy way to display every field in the record. 但是,若要使利用DetailsView控制的高级的功能,必须显式声明要包含在中的行字段DetailsView控件。However, to make use of the DetailsView control's advanced capabilities you must explicitly declare the row fields to include in the DetailsView control. 若要声明的行字段,请首先设置AutoGenerateRows属性设置为falseTo declare the row fields, first set the AutoGenerateRows property to false. 接下来,添加左括号和右<Fields>标记的开始和结束标记之间DetailsView控件。Next, add opening and closing <Fields> tags between the opening and closing tags of the DetailsView control. 最后,列出你想要包括的开始和结束之间的行字段<Fields>标记。Finally, list the row fields that you want to include between the opening and closing <Fields> tags. 指定的行字段添加到Fields集合的顺序列出。The row fields specified are added to the Fields collection in the order listed. Fields集合允许你以编程方式管理中的行字段DetailsView控件。The Fields collection allows you to programmatically manage the row fields in the DetailsView control.

备注

不会自动生成的行字段添加到Fields集合。Automatically generated row fields are not added to the Fields collection.

备注

显式声明的行字段可以显示与自动生成的行字段结合使用。Explicitly declared row fields can be displayed in combination with automatically generated row fields. 同时使用时,显式声明的行字段自动生成的行字段后跟第一次,呈现。When both are used, explicitly declared row fields are rendered first, followed by the automatically generated row fields.

绑定到数据Binding to Data

DetailsView控件可以绑定到数据源控件 (如SqlDataSource控制或ObjectDataSource控件) 或实现任何数据源集合System.Collections.IEnumerable接口,如System.Data.DataViewSystem.Collections.ArrayListSystem.Collections.Generic.List<T>,或其他集合类型。The DetailsView control can be bound to a data source control (such as the SqlDataSource control or ObjectDataSource control) or to any data source collection that implements the System.Collections.IEnumerable interface, such as System.Data.DataView, System.Collections.ArrayList, System.Collections.Generic.List<T>, or other collection types. 使用以下方法之一将绑定DetailsView到适当的数据源类型的控件:Use one of the following methods to bind the DetailsView control to the appropriate data source type:

数据绑定的详细信息,请参阅绑定到数据库For more information on data binding, see Binding to Databases.

安全性Security

此控件用于显示用户输入,这可能包括恶意客户端脚本。This control can be used to display user input, which might include malicious client script. 检查从客户端的可执行脚本、 SQL 语句或其他代码之前发送应用程序中显示的任何信息。Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET 提供了用户输入到脚本块和 HTML 的输入的请求验证功能。ASP.NET provides an input request validation feature to block script and HTML in user input. 有关详细信息,请参阅脚本侵入概述For more information, see Script Exploits Overview. 验证服务器控件还提供用于评估用户输入。Validation server controls are also provided to assess user input. 有关详细信息,请参阅验证服务器控件语法For more information, see Validation Server Control Syntax.

数据操作Data Operations

DetailsView控件提供了内置功能,允许用户更新、 删除、 插入和翻页查看控件中的项。The DetailsView control provides built-in capabilities that allow the user to update, delete, insert, and page through items in the control. DetailsView控件绑定到数据源控件,DetailsView控件可以利用数据源控件的功能并提供自动更新、 删除、 插入和分页功能。When the DetailsView control is bound to a data source control, the DetailsView control can take advantage of the data source control's capabilities and provide automatic updating, deleting, inserting, and paging functionality.

备注

DetailsView控件可为 update、 delete、 insert 和分页操作与其他类型的数据源提供支持; 但是,必须提供相应的事件处理程序中的这些操作的实现。The DetailsView control can provide support for update, delete, insert, and paging operations with other types of data sources; however, you must provide the implementation for these operations in an appropriate event handler. 有关详细信息,请参阅ItemDeletingItemInsertingItemUpdatingFor more information, see ItemDeleting, ItemInserting, and ItemUpdating.

DetailsView控件可自动添加CommandField带有编辑、 删除或新建按钮通过设置行字段AutoGenerateEditButtonAutoGenerateDeleteButton,或AutoGenerateInsertButton属性设置为true分别。The DetailsView control can automatically add a CommandField row field with an Edit, Delete, or New button by setting the AutoGenerateEditButton, AutoGenerateDeleteButton, or AutoGenerateInsertButton properties to true, respectively. 与不同的删除按钮 (它立即删除所选的记录),单击编辑或新建按钮,DetailsView控件进入编辑模式或分别插入模式。Unlike the Delete button (which deletes the selected record immediately), when the Edit or New button is clicked, the DetailsView control goes into edit or insert mode, respectively. 在编辑模式下,编辑按钮是更新和替换取消按钮。In edit mode, the Edit button is replaced with an Update and a Cancel button. 输入适合于字段的数据类型的控件 (如TextBoxCheckBox控件) 显示,用户若要修改的字段的值。Input controls that are appropriate for the field's data type (such as a TextBox or a CheckBox control) are displayed with a field's value for the user to modify. 单击更新按钮更新数据源中的记录,而单击取消按钮会放弃所有更改。Clicking the Update button updates the record in the data source, while clicking the Cancel button abandons any changes. 同样,在插入模式下,使用 Insert 和取消按钮,替换新建按钮和空的输入的控件显示用户输入新记录的值。Likewise, in insert mode, the New button is replaced with an Insert and a Cancel button, and empty input controls are displayed for the user to enter the values for the new record.

备注

您可以手动定义 update、 delete 和 insert 命令按钮ButtonFieldCommandField,或TemplateField行字段。You can also manually define the update, delete, and insert command buttons in a ButtonField, CommandField, or TemplateField row field. DetailsView控件可识别具有按钮CommandName属性设置为"编辑"、"更新"、"删除"、"新建"、"插入"或"取消"; 但是,你仍必须提供功能自己。The DetailsView control recognizes buttons with the CommandName property set to "Edit", "Update", "Delete", "New", "Insert", or "Cancel"; however, you still must provide the functionality yourself. 有关详细信息,请参阅ItemDeletingItemInsertingItemUpdatingFor more information, see ItemDeleting, ItemInserting, and ItemUpdating.

DetailsView控件提供分页功能,这样用户就可以导航到数据源中的其他记录。The DetailsView control provides a paging feature, which allows the user to navigate to other records in the data source. 启用时,页面导航控件显示在页导航行。When enabled, page navigation controls are displayed in a pager row. 若要启用分页,请设置AllowPaging属性设置为trueTo enable paging, set the AllowPaging property to true. 可以使用自定义的页导航行PagerStylePagerSettings属性。The pager row can be customized using the PagerStyle and PagerSettings properties.

自定义用户界面Customizing the User Interface

你可以自定义外观DetailsView通过设置控件的不同部分的样式属性的控件。You can customize the appearance of the DetailsView control by setting the style properties for different parts of the control. 下表列出了可以设置的样式属性。The following table lists the style properties that you can set.

样式属性Style property 描述Description
AlternatingRowStyle 中的交替数据行的样式设置DetailsView控件。The style settings for the alternating data rows in the DetailsView control. 当设置此属性时,数据行显示在带区,之间交替RowStyle设置和AlternatingRowStyle设置。When this property is set, the data rows are displayed in bands, alternating between the RowStyle settings and the AlternatingRowStyle settings.
CommandRowStyle 包含内置命令按钮的行的样式设置。The style settings for the row that contains the built-in command buttons.
EditRowStyle 时行数据的样式设置DetailsView控件处于编辑模式。The style settings for the data rows when the DetailsView control is in edit mode.
EmptyDataRowStyle 中显示的空数据行的样式设置DetailsView控制当数据源不包含任何记录。The style settings for the empty data row that are displayed in the DetailsView control when the data source does not contain any records.
FooterStyle 脚注行的样式设置。The style settings for the footer row.
HeaderStyle 标头行的样式设置。The style settings for the header row.
InsertRowStyle 时行数据的样式设置DetailsView控件处于插入模式。The style settings for the data rows when the DetailsView control is in insert mode.
PagerStyle 页导航行的样式设置。The style settings for the pager row.
RowStyle 中的数据行的样式设置DetailsView控件。The style settings for the data rows in the DetailsView control. AlternatingRowStyle属性也设置,显示数据行之间交替RowStyle设置和AlternatingRowStyle设置。When the AlternatingRowStyle property is also set, the data rows are displayed alternating between the RowStyle settings and the AlternatingRowStyle settings.
FieldHeaderStyle 标题列的样式设置。The style settings for the header column.

事件Events

DetailsView控件提供了几个事件,可以对其进行编程。The DetailsView control provides several events that you can program against. 这样,您可以运行自定义的例程,每当发生的事件。This allows you to run a custom routine whenever an event occurs. 下表列出了支持的事件DetailsView控件。The following table lists the events supported by the DetailsView control. DetailsView控件将这些事件还继承其基类,这些类: DataBindingDataBoundDisposedInitLoadPreRender,和RenderThe DetailsView control also inherits these events from its base classes: DataBinding, DataBound, Disposed, Init, Load, PreRender, and Render.

事件Event 描述Description
ItemCommand DetailsView 控件中单击某个按钮时发生。Occurs when a button is clicked in the DetailsView control.
ItemCreated 发生毕竟DetailsViewRow中创建对象DetailsView控件。Occurs after all DetailsViewRow objects are created in the DetailsView control. 此事件通常用于显示之前修改的记录的值。This event is often used to modify the values of a record before it is displayed.
ItemDeleted 单击删除按钮,但之后时发生DetailsView控件从数据源中删除记录。Occurs when a Delete button is clicked, but after the DetailsView control deletes the record from the data source. 此事件通常用于检查删除操作的结果。This event is often used to check the results of the delete operation.
ItemDeleting 单击删除按钮,之前时发生DetailsView控件从数据源中删除记录。Occurs when a Delete button is clicked, but before the DetailsView control deletes the record from the data source. 此事件通常用于取消删除操作。This event is often used to cancel the delete operation.
ItemInserted 单击插入按钮,但之后时发生DetailsView控件插入记录。Occurs when an Insert button is clicked, but after the DetailsView control inserts the record. 此事件通常用于检查 insert 操作的结果。This event is often used to check the results of the insert operation.
ItemInserting 单击插入按钮,之前时发生DetailsView控件插入记录。Occurs when an Insert button is clicked, but before the DetailsView control inserts the record. 此事件通常用于取消插入操作。This event is often used to cancel the insert operation.
ItemUpdated 单击更新按钮,但之后时发生DetailsView控件对该行进行更新。Occurs when an Update button is clicked, but after the DetailsView control updates the row. 此事件通常用于检查更新操作的结果。This event is often used to check the results of the update operation.
ItemUpdating 单击更新按钮,之前时发生DetailsView控件更新的记录。Occurs when an Update button is clicked, but before the DetailsView control updates the record. 此事件通常用于取消更新操作。This event is often used to cancel the update operation.
ModeChanged 之后,将会DetailsView控件更改 (编辑、 插入或只读模式下) 的模式。Occurs after the DetailsView control changes modes (edit, insert, or read-only mode). 此事件通常用于执行某项任务时DetailsView控件更改模式。This event is often used to perform a task when the DetailsView control changes modes.
ModeChanging 之前发生DetailsView控件更改 (编辑、 插入或只读模式下) 的模式。Occurs before the DetailsView control changes modes (edit, insert, or read-only mode). 此事件通常用于取消模式更改。This event is often used to cancel a mode change.
PageIndexChanged 在单击某一页导航按钮时,但在 DetailsView 控件处理分页操作之后发生。Occurs when one of the pager buttons is clicked, but after the DetailsView control handles the paging operation. 当您需要执行的任务后用户导航到该控件中的不同记录时,通常使用此事件。This event is commonly used when you need to perform a task after the user navigates to a different record in the control.
PageIndexChanging 在单击某一页导航按钮时,但在 DetailsView 控件处理分页操作之前发生。Occurs when one of the pager buttons is clicked, but before the DetailsView control handles the paging operation. 此事件通常用于取消分页操作。This event is often used to cancel the paging operation.

可访问性Accessibility

有关如何配置此控件,以便它将生成符合辅助功能标准标记的信息,请参阅Visual Studio 和 ASP.NET 中的辅助功能ASP.NET 控件和可访问性.For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio and ASP.NET and ASP.NET Controls and Accessibility.

声明性语法Declarative Syntax

<asp:DetailsView  
    AccessKey="string"  
    AllowPaging="True|False"  
    AutoGenerateDeleteButton="True|False"  
    AutoGenerateEditButton="True|False"  
    AutoGenerateInsertButton="True|False"  
    AutoGenerateRows="True|False"  
    BackColor="color name|#dddddd"  
    BackImageUrl="uri"  
    BorderColor="color name|#dddddd"  
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|  
        Inset|Outset"  
    BorderWidth="size"  
    Caption="string"  
    CaptionAlign="NotSet|Top|Bottom|Left|Right"  
    CellPadding="integer"  
    CellSpacing="integer"  
    CssClass="string"  
    DataKeyNames="string"  
    DataMember="string"  
    DataSource="string"  
    DataSourceID="string"  
    DefaultMode="ReadOnly|Edit|Insert"  
    EmptyDataText="string"  
    Enabled="True|False"  
    EnablePagingCallbacks="True|False"  
    EnableTheming="True|False"  
    EnableViewState="True|False"  
    Font-Bold="True|False"  
    Font-Italic="True|False"  
    Font-Names="string"  
    Font-Overline="True|False"  
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|  
        Large|X-Large|XX-Large"  
    Font-Strikeout="True|False"  
    Font-Underline="True|False"  
    FooterText="string"  
    ForeColor="color name|#dddddd"  
    GridLines="None|Horizontal|Vertical|Both"  
    HeaderText="string"  
    Height="size"  
    HorizontalAlign="NotSet|Left|Center|Right|Justify"  
    ID="string"  
    OnDataBinding="DataBinding event handler"  
    OnDataBound="DataBound event handler"  
    OnDisposed="Disposed event handler"  
    OnInit="Init event handler"  
    OnItemCommand="ItemCommand event handler"  
    OnItemCreated="ItemCreated event handler"  
    OnItemDeleted="ItemDeleted event handler"  
    OnItemDeleting="ItemDeleting event handler"  
    OnItemInserted="ItemInserted event handler"  
    OnItemInserting="ItemInserting event handler"  
    OnItemUpdated="ItemUpdated event handler"  
    OnItemUpdating="ItemUpdating event handler"  
    OnLoad="Load event handler"  
    OnModeChanged="ModeChanged event handler"  
    OnModeChanging="ModeChanging event handler"  
    OnPageIndexChanged="PageIndexChanged event handler"  
    OnPageIndexChanging="PageIndexChanging event handler"  
    OnPreRender="PreRender event handler"  
    OnUnload="Unload event handler"  
    PageIndex="integer"  
    PagerSettings-FirstPageImageUrl="uri"  
    PagerSettings-FirstPageText="string"  
    PagerSettings-LastPageImageUrl="uri"  
    PagerSettings-LastPageText="string"  
    PagerSettings-Mode="NextPrevious|Numeric|NextPreviousFirstLast|NumericFirstLast"  
    PagerSettings-NextPageImageUrl="uri"  
    PagerSettings-NextPageText="string"  
    PagerSettings-PageButtonCount="integer"  
    PagerSettings-Position="Bottom|Top|TopAndBottom"  
    PagerSettings-PreviousPageImageUrl="uri"  
    PagerSettings-PreviousPageText="string"  
    PagerSettings-Visible="True|False"  
    runat="server"  
    SkinID="string"  
    Style="string"  
    TabIndex="integer"  
    ToolTip="string"  
    Visible="True|False"  
    Width="size"  
>  
        <AlternatingRowStyle />  
        <CommandRowStyle />  
        <EditRowStyle />  
        <EmptyDataRowStyle />  
        <EmptyDataTemplate>  
            <!-- child controls -->  
        </EmptyDataTemplate>  
        <FieldHeaderStyle />  
        <Fields>  
                <asp:BoundField  
                    AccessibleHeaderText="string"  
                    ApplyFormatInEditMode="True|False"  
                    ConvertEmptyStringToNull="True|False"  
                    DataField="string"  
                    DataFormatString="string"  
                    FooterText="string"  
                    HeaderImageUrl="uri"  
                    HeaderText="string"  
                    HtmlEncode="True|False"  
                    InsertVisible="True|False"  
                    NullDisplayText="string"  
                    ReadOnly="True|False"  
                    ShowHeader="True|False"  
                    SortExpression="string"  
                    Visible="True|False"  
>  
                        <ControlStyle />  
                        <FooterStyle />  
                        <HeaderStyle />  
                        <ItemStyle />  
                </asp:BoundField>  
                <asp:ButtonField  
                    AccessibleHeaderText="string"  
                    ButtonType="Button|Image|Link"  
                    CausesValidation="True|False"  
                    CommandName="string"  
                    DataTextField="string"  
                    DataTextFormatString="string"  
                    FooterText="string"  
                    HeaderImageUrl="uri"  
                    HeaderText="string"  
                    ImageUrl="uri"  
                    InsertVisible="True|False"  
                    ShowHeader="True|False"  
                    SortExpression="string"  
                    Text="string"  
                    ValidationGroup="string"  
                    Visible="True|False"  
>  
                        <ControlStyle />  
                        <FooterStyle />  
                        <HeaderStyle />  
                        <ItemStyle />  
                </asp:ButtonField>  
                <asp:CheckBoxField  
                    AccessibleHeaderText="string"  
                    DataField="string"  
                    FooterText="string"  
                    HeaderImageUrl="uri"  
                    HeaderText="string"  
                    InsertVisible="True|False"  
                    ReadOnly="True|False"  
                    ShowHeader="True|False"  
                    SortExpression="string"  
                    Text="string"  
                    Visible="True|False"  
>  
                        <ControlStyle />  
                        <FooterStyle />  
                        <HeaderStyle />  
                        <ItemStyle />  
                </asp:CheckBoxField>  
                <asp:CommandField  
                    AccessibleHeaderText="string"  
                    ButtonType="Button|Image|Link"  
                    CancelImageUrl="uri"  
                    CancelText="string"  
                    CausesValidation="True|False"  
                    DeleteImageUrl="uri"  
                    DeleteText="string"  
                    EditImageUrl="uri"  
                    EditText="string"  
                    FooterText="string"  
                    HeaderImageUrl="uri"  
                    HeaderText="string"  
                    InsertImageUrl="uri"  
                    InsertText="string"  
                    InsertVisible="True|False"  
                    NewImageUrl="uri"  
                    NewText="string"  
                    SelectImageUrl="uri"  
                    SelectText="string"  
                    ShowCancelButton="True|False"  
                    ShowDeleteButton="True|False"  
                    ShowEditButton="True|False"  
                    ShowHeader="True|False"  
                    ShowInsertButton="True|False"  
                    ShowSelectButton="True|False"  
                    SortExpression="string"  
                    UpdateImageUrl="uri"  
                    UpdateText="string"  
                    ValidationGroup="string"  
                    Visible="True|False"  
>  
                        <ControlStyle />  
                        <FooterStyle />  
                        <HeaderStyle />  
                        <ItemStyle />  
                </asp:CommandField>  
                <asp:DynamicField  
                    AccessibleHeaderText="string"  
                    ApplyFormatInEditMode="True|False"  
                    ConvertEmptyStringToNull="True|False"  
                    DataField="string"  
                    DataFormatString="string"  
                    FooterText="string"  
                    HeaderImageUrl="uri"  
                    HeaderText="string"  
                    HtmlEncode="True|False"  
                    InsertVisible="True|False"  
                    NullDisplayText="string"  
                    ShowHeader="True|False"  
                    UIHint="string"  
                    Visible="True|False"  
>  
                        <ControlStyle />  
                        <FooterStyle />  
                        <HeaderStyle />  
                        <ItemStyle />  
                </asp:DynamicField>  
                <asp:HyperLinkField  
                    AccessibleHeaderText="string"  
                    DataNavigateUrlFields="string"  
                    DataNavigateUrlFormatString="string"  
                    DataTextField="string"  
                    DataTextFormatString="string"  
                    FooterText="string"  
                    HeaderImageUrl="uri"  
                    HeaderText="string"  
                    InsertVisible="True|False"  
                    NavigateUrl="uri"  
                    ShowHeader="True|False"  
                    SortExpression="string"  
                    Target="string|_blank|_parent|_search|_self|_top"  
                    Text="string"  
                    Visible="True|False"  
>  
                        <ControlStyle />  
                        <FooterStyle />  
                        <HeaderStyle />  
                        <ItemStyle />  
                </asp:HyperLinkField>  
                <asp:ImageField  
                    AccessibleHeaderText="string"  
                    AlternateText="string"  
                    ConvertEmptyStringToNull="True|False"  
                    DataAlternateTextField="string"  
                    DataAlternateTextFormatString="string"  
                    DataImageUrlField="string"  
                    DataImageUrlFormatString="string"  
                    FooterText="string"  
                    HeaderImageUrl="uri"  
                    HeaderText="string"  
                    InsertVisible="True|False"  
                    NullDisplayText="string"  
                    NullImageUrl="uri"  
                    ReadOnly="True|False"  
                    ShowHeader="True|False"  
                    SortExpression="string"  
                    Visible="True|False"  
>  
                        <ControlStyle />  
                        <FooterStyle />  
                        <HeaderStyle />  
                        <ItemStyle />  
                </asp:ImageField>  
                <asp:TemplateField  
                    AccessibleHeaderText="string"  
                    ConvertEmptyStringToNull="True|False"  
                    FooterText="string"  
                    HeaderImageUrl="uri"  
                    HeaderText="string"  
                    InsertVisible="True|False"  
                    ShowHeader="True|False"  
                    SortExpression="string"  
                    Visible="True|False"  
>  
                            <ControlStyle />  
                            <FooterStyle />  
                            <HeaderStyle />  
                            <ItemStyle />  
                        <AlternatingItemTemplate>  
                            <!-- child controls -->  
                        </AlternatingItemTemplate>  
                        <EditItemTemplate>  
                            <!-- child controls -->  
                        </EditItemTemplate>  
                        <FooterTemplate>  
                            <!-- child controls -->  
                        </FooterTemplate>  
                        <HeaderTemplate>  
                            <!-- child controls -->  
                        </HeaderTemplate>  
                        <InsertItemTemplate>  
                            <!-- child controls -->  
                        </InsertItemTemplate>  
                        <ItemTemplate>  
                            <!-- child controls -->  
                        </ItemTemplate>  
                </asp:TemplateField>  
        </Fields>  
        <FooterStyle />  
        <FooterTemplate>  
            <!-- child controls -->  
        </FooterTemplate>  
        <HeaderStyle />  
        <HeaderTemplate>  
            <!-- child controls -->  
        </HeaderTemplate>  
        <InsertRowStyle />  
        <PagerSettings  
            FirstPageImageUrl="uri"  
            FirstPageText="string"  
            LastPageImageUrl="uri"  
            LastPageText="string"  
            Mode="NextPrevious|Numeric|NextPreviousFirstLast|  
                NumericFirstLast"  
            NextPageImageUrl="uri"  
            NextPageText="string"  
            OnPropertyChanged="PropertyChanged event handler"  
            PageButtonCount="integer"  
            Position="Bottom|Top|TopAndBottom"  
            PreviousPageImageUrl="uri"  
            PreviousPageText="string"  
            Visible="True|False"  
        />  
        <PagerStyle />  
        <PagerTemplate>  
            <!-- child controls -->  
        </PagerTemplate>  
        <RowStyle        />  
</asp:DetailsView>  

构造函数

DetailsView() DetailsView() DetailsView() DetailsView()

初始化 DetailsView 类的新实例。Initializes a new instance of the DetailsView class.

属性

AccessKey AccessKey AccessKey AccessKey

获取或设置使您得以快速导航到 Web 服务器控件的访问键。Gets or sets the access key that allows you to quickly navigate to the Web server control.

(Inherited from WebControl)
Adapter Adapter Adapter Adapter

获取控件的浏览器特定适配器。Gets the browser-specific adapter for the control.

(Inherited from Control)
AllowPaging AllowPaging AllowPaging AllowPaging

获取或设置一个值,该值指示是否启用分页功能。Gets or sets a value indicating whether the paging feature is enabled.

AlternatingRowStyle AlternatingRowStyle AlternatingRowStyle AlternatingRowStyle

获取对 TableItemStyle 对象的引用,该对象允许您设置 DetailsView 控件中的交替数据行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the alternating data rows in a DetailsView control.

AppRelativeTemplateSourceDirectory AppRelativeTemplateSourceDirectory AppRelativeTemplateSourceDirectory AppRelativeTemplateSourceDirectory

获取或设置包含该控件的 PageUserControl 对象的应用程序相对虚拟目录。Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.

(Inherited from Control)
Attributes Attributes Attributes Attributes

获取与控件的特性不对应的任意特性(只用于呈现)的集合。Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control.

(Inherited from WebControl)
AutoGenerateDeleteButton AutoGenerateDeleteButton AutoGenerateDeleteButton AutoGenerateDeleteButton

获取或设置一个值,该值指示用来删除当前记录的内置控件是否在 DetailsView 控件中显示。Gets or sets a value indicating whether the built-in control to delete the current record is displayed in a DetailsView control.

AutoGenerateEditButton AutoGenerateEditButton AutoGenerateEditButton AutoGenerateEditButton

获取或设置一个值,该值指示用来编辑当前记录的内置控件是否在 DetailsView 控件中显示。Gets or sets a value indicating whether the built-in controls to edit the current record are displayed in a DetailsView control.

AutoGenerateInsertButton AutoGenerateInsertButton AutoGenerateInsertButton AutoGenerateInsertButton

获取或设置一个值,该值指示用来插入新记录的内置控件是否在 DetailsView 控件中显示。Gets or sets a value indicating whether the built-in controls to insert a new record are displayed in a DetailsView control.

AutoGenerateRows AutoGenerateRows AutoGenerateRows AutoGenerateRows

获取或设置一个值,该值指示对应于数据源中每个字段的行字段是否自动生成并在 DetailsView 控件中显示。Gets or sets a value indicating whether row fields for each field in the data source are automatically generated and displayed in a DetailsView control.

BackColor BackColor BackColor BackColor

获取或设置 Web 服务器控件的背景色。Gets or sets the background color of the Web server control.

(Inherited from WebControl)
BackImageUrl BackImageUrl BackImageUrl BackImageUrl

获取或设置要在 DetailsView 控件的背景中显示的图像的 URL。Gets or sets the URL to an image to display in the background of a DetailsView control.

BindingContainer BindingContainer BindingContainer BindingContainer

获取包含该控件的数据绑定的控件。Gets the control that contains this control's data binding.

(Inherited from Control)
BorderColor BorderColor BorderColor BorderColor

获取或设置 Web 控件的边框颜色。Gets or sets the border color of the Web control.

(Inherited from WebControl)
BorderStyle BorderStyle BorderStyle BorderStyle

获取或设置 Web 服务器控件的边框样式。Gets or sets the border style of the Web server control.

(Inherited from WebControl)
BorderWidth BorderWidth BorderWidth BorderWidth

获取或设置 Web 服务器控件的边框宽度。Gets or sets the border width of the Web server control.

(Inherited from WebControl)
BottomPagerRow BottomPagerRow BottomPagerRow BottomPagerRow

获取一个 DetailsViewRow 对象,该对象表示 DetailsView 控件中的底部页导航行。Gets a DetailsViewRow object that represents the bottom pager row in a DetailsView control.

Caption Caption Caption Caption

获取或设置要在 DetailsView 控件的 HTML 标题元素中呈现的文本。Gets or sets the text to render in an HTML caption element in a DetailsView control. 提供此属性的目的是使辅助技术设备的用户更易于访问控件。This property is provided to make the control more accessible to users of assistive technology devices.

CaptionAlign CaptionAlign CaptionAlign CaptionAlign

获取或设置 DetailsView 控件中的 HTML 标题元素的水平或垂直位置。Gets or sets the horizontal or vertical position of the HTML caption element in a DetailsView control. 提供此属性的目的是使辅助技术设备的用户更易于访问控件。This property is provided to make the control more accessible to users of assistive technology devices.

CellPadding CellPadding CellPadding CellPadding

获取或设置单元格的内容和单元格的边框之间的空间量。Gets or sets the amount of space between the contents of a cell and the cell's border.

CellSpacing CellSpacing CellSpacing CellSpacing

获取或设置单元格间的空间量。Gets or sets the amount of space between cells.

ChildControlsCreated ChildControlsCreated ChildControlsCreated ChildControlsCreated

获取一个值,该值指示是否已创建服务器控件的子控件。Gets a value that indicates whether the server control's child controls have been created.

(Inherited from Control)
ClientID ClientID ClientID ClientID

获取由 ASP.NET 生成的 HTML 标记的控件 ID。Gets the control ID for HTML markup that is generated by ASP.NET.

(Inherited from Control)
ClientIDMode ClientIDMode ClientIDMode ClientIDMode

获取或设置用于生成 ClientID 属性值的算法。Gets or sets the algorithm that is used to generate the value of the ClientID property.

(Inherited from Control)
ClientIDSeparator ClientIDSeparator ClientIDSeparator ClientIDSeparator

获取一个字符值,该值表示 ClientID 属性中使用的分隔符字符。Gets a character value representing the separator character used in the ClientID property.

(Inherited from Control)
CommandRowStyle CommandRowStyle CommandRowStyle CommandRowStyle

获取对 TableItemStyle 对象的引用,该对象允许您设置 DetailsView 控件中的命令行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of a command row in a DetailsView control.

Context Context Context Context

为当前 Web 请求获取与服务器控件关联的 HttpContext 对象。Gets the HttpContext object associated with the server control for the current Web request.

(Inherited from Control)
Controls Controls Controls Controls

获取复合数据绑定控件内的子控件的集合。Gets a collection of the child controls within the composite data-bound control.

(Inherited from CompositeDataBoundControl)
ControlStyle ControlStyle ControlStyle ControlStyle

获取 Web 服务器控件的样式。Gets the style of the Web server control. 此属性主要由控件开发人员使用。This property is used primarily by control developers.

(Inherited from WebControl)
ControlStyleCreated ControlStyleCreated ControlStyleCreated ControlStyleCreated

获取一个值,该值指示是否已为 Style 属性创建了 ControlStyle 对象。Gets a value indicating whether a Style object has been created for the ControlStyle property. 此属性主要由控件开发人员使用。This property is primarily used by control developers.

(Inherited from WebControl)
CssClass CssClass CssClass CssClass

获取或设置由 Web 服务器控件在客户端呈现的级联样式表 (CSS) 类。Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client.

(Inherited from WebControl)
CurrentMode CurrentMode CurrentMode CurrentMode

获取 DetailsView 控件的当前数据输入模式。Gets the current data-entry mode of the DetailsView control.

DataItem DataItem DataItem DataItem

获取绑定到 DetailsView 控件的数据项。Gets the data item bound to the DetailsView control.

DataItemContainer DataItemContainer DataItemContainer DataItemContainer

如果命名容器实现 IDataItemContainer,则获取对命名容器的引用。Gets a reference to the naming container if the naming container implements IDataItemContainer.

(Inherited from Control)
DataItemCount DataItemCount DataItemCount DataItemCount

获取基础数据源中的项数。Gets the number of items in the underlying data source.

DataItemIndex DataItemIndex DataItemIndex DataItemIndex

从基础数据源中获取 DetailsView 控件中正在显示的项的索引。Gets the index of the item being displayed in a DetailsView control from the underlying data source.

DataKey DataKey DataKey DataKey

获取一个 DataKey 对象,该对象表示所显示的记录的主键。Gets a DataKey object that represents the primary key of the displayed record.

DataKeyNames DataKeyNames DataKeyNames DataKeyNames

获取或设置一个数组,该数组包含数据源的键字段的名称。Gets or sets an array that contains the names of the key fields for the data source.

DataKeysContainer DataKeysContainer DataKeysContainer DataKeysContainer

如果命名容器实现 IDataKeysControl,则获取对命名容器的引用。Gets a reference to the naming container if the naming container implements IDataKeysControl.

(Inherited from Control)
DataMember DataMember DataMember DataMember

当数据源包含多个不同的数据项列表时,获取或设置数据绑定控件绑定到的数据列表的名称。Gets or sets the name of the list of data that the data-bound control binds to, in cases where the data source contains more than one distinct list of data items.

(Inherited from DataBoundControl)
DataSource DataSource DataSource DataSource

获取或设置对象,数据绑定控件从该对象中检索其数据项列表。Gets or sets the object from which the data-bound control retrieves its list of data items.

(Inherited from BaseDataBoundControl)
DataSourceID DataSourceID DataSourceID DataSourceID

获取或设置控件的 ID,数据绑定控件从该控件中检索其数据项列表。Gets or sets the ID of the control from which the data-bound control retrieves its list of data items.

(Inherited from DataBoundControl)
DataSourceObject DataSourceObject DataSourceObject DataSourceObject

获取一个对象,该对象实现 IDataSource 接口,以便提供对该对象的数据内容的访问。Gets an object that implements the IDataSource interface, which provides access to the object's data content.

(Inherited from DataBoundControl)
DefaultMode DefaultMode DefaultMode DefaultMode

获取或设置 DetailsView 控件的默认数据输入模式。Get or sets the default data-entry mode of the DetailsView control.

DeleteMethod DeleteMethod DeleteMethod DeleteMethod

获取或设置控件执行删除操作时调用的页面上的方法的名称。Gets or sets the name of the method on the page that is called when the control performs a delete operation.

DesignMode DesignMode DesignMode DesignMode

获取一个值,该值指示是否正在使用设计图面上的一个控件。Gets a value indicating whether a control is being used on a design surface.

(Inherited from Control)
EditRowStyle EditRowStyle EditRowStyle EditRowStyle

获取一个对 TableItemStyle 对象的引用,该对象允许您设置在 DetailsView 控件处于编辑模式时数据行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the data rows when a DetailsView control is in edit mode.

EmptyDataRowStyle EmptyDataRowStyle EmptyDataRowStyle EmptyDataRowStyle

获取一个对 TableItemStyle 对象的引用,使用该对象可以设置在绑定到 DetailsView 控件的数据源不包含任何记录时所显示的空数据行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the empty data row displayed when the data source bound to a DetailsView control does not contain any records.

EmptyDataTemplate EmptyDataTemplate EmptyDataTemplate EmptyDataTemplate

获取或设置在 DetailsView 控件绑定到不包含任何记录的数据源时所呈现的空数据行的用户定义内容。Gets or sets the user-defined content for the empty data row rendered when a DetailsView control is bound to a data source that does not contain any records.

EmptyDataText EmptyDataText EmptyDataText EmptyDataText

获取或设置在 DetailsView 控件绑定到不包含任何记录的数据源时所呈现的空数据行中显示的文本。Gets or sets the text to display in the empty data row rendered when a DetailsView control is bound to a data source that does not contain any records.

Enabled Enabled Enabled Enabled

获取或设置一个值,该值指示是否启用 Web 服务器控件。Gets or sets a value indicating whether the Web server control is enabled.

(Inherited from WebControl)
EnableModelValidation EnableModelValidation EnableModelValidation EnableModelValidation

获取或设置一个值,该值指示是否启用数据模型验证。Gets or sets a value that indicates whether data-model validation is enabled.

EnablePagingCallbacks EnablePagingCallbacks EnablePagingCallbacks EnablePagingCallbacks

获取或设置一个值,该值指示客户端回调函数是否用于 DetailsView 控件中的分页操作。Gets or sets a value indicating whether client-side callback functions are used for paging operations in the DetailsView control.

EnableTheming EnableTheming EnableTheming EnableTheming

获取或设置一个值,该值指示主题是否应用于该控件。Gets or sets a value indicating whether themes apply to this control.

(Inherited from WebControl)
EnableViewState EnableViewState EnableViewState EnableViewState

获取或设置一个值,该值指示服务器控件是否向发出请求的客户端保持自己的视图状态以及它所包含的任何子控件的视图状态。Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

(Inherited from Control)
Events Events Events Events

获取控件的事件处理程序委托列表。Gets a list of event handler delegates for the control. 此属性是只读的。This property is read-only.

(Inherited from Control)
FieldHeaderStyle FieldHeaderStyle FieldHeaderStyle FieldHeaderStyle

获取对 TableItemStyle 对象的引用,该对象允许您设置 DetailsView 控件中的标题列的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the header column in a DetailsView control.

Fields Fields Fields Fields

获取 DataControlField 对象的集合,这些对象表示 DetailsView 控件中显式声明的行字段。Gets a collection of DataControlField objects that represent the explicitly declared row fields in a DetailsView control.

Font Font Font Font

获取与 Web 服务器控件关联的字体属性。Gets the font properties associated with the Web server control.

(Inherited from WebControl)
FooterRow FooterRow FooterRow FooterRow

获取表示 DetailsViewRow 控件中的脚注行的 DetailsView 对象。Gets a DetailsViewRow object that represents the footer row in a DetailsView control.

FooterStyle FooterStyle FooterStyle FooterStyle

获取一个对 TableItemStyle 对象的引用,使用该对象可以设置 DetailsView 控件中的脚注行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the footer row in a DetailsView control.

FooterTemplate FooterTemplate FooterTemplate FooterTemplate

获取或设置 DetailsView 控件中的脚注行的用户定义内容。Gets or sets the user-defined content for the footer row in a DetailsView control.

FooterText FooterText FooterText FooterText

获取或设置要在 DetailsView 控件的脚注行中显示的文本。Gets or sets the text to display in the footer row of a DetailsView control.

ForeColor ForeColor ForeColor ForeColor

获取或设置 Web 服务器控件的前景色(通常是文本颜色)。Gets or sets the foreground color (typically the color of the text) of the Web server control.

(Inherited from WebControl)
GridLines GridLines GridLines GridLines

获取或设置 DetailsView 控件的网格线样式。Gets or sets the gridline style for a DetailsView control.

HasAttributes HasAttributes HasAttributes HasAttributes

获取一个值,该值指示控件是否具有特性集。Gets a value indicating whether the control has attributes set.

(Inherited from WebControl)
HasChildViewState HasChildViewState HasChildViewState HasChildViewState

获取一个值,该值指示当前服务器控件的子控件是否具有任何已保存的视图状态设置。Gets a value indicating whether the current server control's child controls have any saved view-state settings.

(Inherited from Control)
HeaderRow HeaderRow HeaderRow HeaderRow

获取表示 DetailsViewRow 控件中的标题行的 DetailsView 对象。Gets a DetailsViewRow object that represents the header row in a DetailsView control.

HeaderStyle HeaderStyle HeaderStyle HeaderStyle

获取一个对 TableItemStyle 对象的引用,使用该对象可以设置 DetailsView 控件中的标题行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the header row in a DetailsView control.

HeaderTemplate HeaderTemplate HeaderTemplate HeaderTemplate

获取或设置 DetailsView 控件中的标题行的用户定义内容。Gets or sets the user-defined content for the header row in a DetailsView control.

HeaderText HeaderText HeaderText HeaderText

获取或设置要在 DetailsView 控件的标题行中显示的文本。Gets or sets the text to display in the header row of a DetailsView control.

Height Height Height Height

获取或设置 Web 服务器控件的高度。Gets or sets the height of the Web server control.

(Inherited from WebControl)
HorizontalAlign HorizontalAlign HorizontalAlign HorizontalAlign

获取或设置 DetailsView 控件在页面上的水平对齐方式。Gets or sets the horizontal alignment of a DetailsView control on the page.

IControlBuilderAccessor.ControlBuilder IControlBuilderAccessor.ControlBuilder IControlBuilderAccessor.ControlBuilder IControlBuilderAccessor.ControlBuilder

有关此成员的说明,请参见 ControlBuilderFor a description of this member, see ControlBuilder.

(Inherited from Control)
IControlDesignerAccessor.UserData IControlDesignerAccessor.UserData IControlDesignerAccessor.UserData IControlDesignerAccessor.UserData

有关此成员的说明,请参见 UserDataFor a description of this member, see UserData.

(Inherited from Control)
ID ID ID ID

获取或设置分配给服务器控件的编程标识符。Gets or sets the programmatic identifier assigned to the server control.

(Inherited from Control)
IDataBindingsAccessor.DataBindings IDataBindingsAccessor.DataBindings IDataBindingsAccessor.DataBindings IDataBindingsAccessor.DataBindings

有关此成员的说明,请参见 DataBindingsFor a description of this member, see DataBindings.

(Inherited from Control)
IDataBindingsAccessor.HasDataBindings IDataBindingsAccessor.HasDataBindings IDataBindingsAccessor.HasDataBindings IDataBindingsAccessor.HasDataBindings

有关此成员的说明,请参见 HasDataBindingsFor a description of this member, see HasDataBindings.

(Inherited from Control)
IdSeparator IdSeparator IdSeparator IdSeparator

获取用于分隔控件标识符的字符。Gets the character used to separate control identifiers.

(Inherited from Control)
IExpressionsAccessor.Expressions IExpressionsAccessor.Expressions IExpressionsAccessor.Expressions IExpressionsAccessor.Expressions

有关此成员的说明,请参见 ExpressionsFor a description of this member, see Expressions.

(Inherited from Control)
IExpressionsAccessor.HasExpressions IExpressionsAccessor.HasExpressions IExpressionsAccessor.HasExpressions IExpressionsAccessor.HasExpressions

有关此成员的说明,请参见 HasExpressionsFor a description of this member, see HasExpressions.

(Inherited from Control)
Initialized Initialized Initialized Initialized

获取一个值,该值指示数据绑定控件是否已经初始化。Gets a value indicating whether the data-bound control has been initialized.

(Inherited from BaseDataBoundControl)
InsertMethod InsertMethod InsertMethod InsertMethod

获取或设置控件执行插入操作时调用的页面上的方法的名称。Gets or sets the name of the method on the page that is called when the control performs an insert operation.

InsertRowStyle InsertRowStyle InsertRowStyle InsertRowStyle

获取一个对 TableItemStyle 对象的引用,该对象允许您设置在 DetailsView 控件处于插入模式时 DetailsView 控件中的数据行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the data rows in a DetailsView control when the DetailsView control is in insert mode.

IsBoundUsingDataSourceID IsBoundUsingDataSourceID IsBoundUsingDataSourceID IsBoundUsingDataSourceID

获取指示是否设置 DataSourceID 属性的值。Gets a value indicating whether the DataSourceID property is set.

(Inherited from BaseDataBoundControl)
IsChildControlStateCleared IsChildControlStateCleared IsChildControlStateCleared IsChildControlStateCleared

获取一个值,该值指示该控件中包含的控件是否具有控件状态。Gets a value indicating whether controls contained within this control have control state.

(Inherited from Control)
IsDataBindingAutomatic IsDataBindingAutomatic IsDataBindingAutomatic IsDataBindingAutomatic

获取一个值,该值指示数据绑定是否自动进行。Gets a value that indicates whether data binding is automatic.

(Inherited from BaseDataBoundControl)
IsEnabled IsEnabled IsEnabled IsEnabled

获取一个值,该值指示是否启用控件。Gets a value indicating whether the control is enabled.

(Inherited from WebControl)
IsTrackingViewState IsTrackingViewState IsTrackingViewState IsTrackingViewState

获取一个值,用于指示服务器控件是否会将更改保存到其视图状态中。Gets a value that indicates whether the server control is saving changes to its view state.

(Inherited from Control)
IsUsingModelBinders IsUsingModelBinders IsUsingModelBinders IsUsingModelBinders

获取一个值,该值指示是否使用模型绑定。Gets a value that indicates whether model binding is in use.

(Inherited from CompositeDataBoundControl)
IsViewStateEnabled IsViewStateEnabled IsViewStateEnabled IsViewStateEnabled

获取一个值,该值指示是否为该控件启用了视图状态。Gets a value indicating whether view state is enabled for this control.

(Inherited from Control)
ItemType ItemType ItemType ItemType

获取或设置强类型化数据绑定的数据项目类型的名称。Gets or sets the name of the data item type for strongly typed data binding.

(Inherited from DataBoundControl)
LoadViewStateByID LoadViewStateByID LoadViewStateByID LoadViewStateByID

获取一个值,该值指示控件是否通过 ID 而不是索引参与加载其视图状态。Gets a value indicating whether the control participates in loading its view state by ID instead of index.

(Inherited from Control)
NamingContainer NamingContainer NamingContainer NamingContainer

获取对服务器控件的命名容器的引用,此引用创建唯一的命名空间,以区分具有相同 ID 属性值的服务器控件。Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value.

(Inherited from Control)
Page Page Page Page

获取对包含服务器控件的 Page 实例的引用。Gets a reference to the Page instance that contains the server control.

(Inherited from Control)
PageCount PageCount PageCount PageCount

获取数据源中的记录数。Gets the number of records in the data source.

PageIndex PageIndex PageIndex PageIndex

获取或设置所显示的记录的索引。Gets or sets the index of the displayed record.

PagerSettings PagerSettings PagerSettings PagerSettings

获取一个对 PagerSettings 对象的引用,使用该对象可以设置 DetailsView 控件中的页导航按钮的属性。Gets a reference to the PagerSettings object that allows you to set the properties of the pager buttons in a DetailsView control.

PagerStyle PagerStyle PagerStyle PagerStyle

获取一个对 TableItemStyle 对象的引用,使用该对象可以设置 DetailsView 控件中的页导航行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the pager row in a DetailsView control.

PagerTemplate PagerTemplate PagerTemplate PagerTemplate

获取或设置 DetailsView 控件中页导航行的自定义内容。Gets or sets the custom content for the pager row in a DetailsView control.

Parent Parent Parent Parent

获取对页 UI 层次结构中服务器控件的父控件的引用。Gets a reference to the server control's parent control in the page control hierarchy.

(Inherited from Control)
RenderingCompatibility RenderingCompatibility RenderingCompatibility RenderingCompatibility

获取一个值,该值指定呈现的 HTML 将与之兼容的 ASP.NET 版本。Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.

(Inherited from Control)
RequiresDataBinding RequiresDataBinding RequiresDataBinding RequiresDataBinding

获取或设置一个值,该值指示是否应调用 DataBind() 方法。Gets or sets a value indicating whether the DataBind() method should be called.

(Inherited from BaseDataBoundControl)
Rows Rows Rows Rows

获取表示 DetailsViewRow 控件中数据行的 DetailsView 对象的集合。Gets a collection of DetailsViewRow objects that represent the data rows in a DetailsView control.

RowsGenerator RowsGenerator RowsGenerator RowsGenerator

获取或设置一个对象,该对象实现 IAutoFieldGenerator 接口,以便自动填充视图中的行。Gets or sets an object that implements the IAutoFieldGenerator interface in order to automatically populate rows in the view.

RowStyle RowStyle RowStyle RowStyle

获取对 TableItemStyle 对象的引用,该对象允许您设置 DetailsView 控件中的数据行的外观。Gets a reference to the TableItemStyle object that allows you to set the appearance of the data rows in a DetailsView control.

SelectArguments SelectArguments SelectArguments SelectArguments

获取数据绑定控件从数据源控件检索数据时使用的 DataSourceSelectArguments 对象。Gets a DataSourceSelectArguments object that the data-bound control uses when retrieving data from a data source control.

(Inherited from DataBoundControl)
SelectedValue SelectedValue SelectedValue SelectedValue

获取 DetailsView 控件中的当前记录的数据键值。Gets the data key value of the current record in a DetailsView control.

SelectMethod SelectMethod SelectMethod SelectMethod

为了读取数据要调用的方法的名称。The name of the method to call in order to read data.

(Inherited from DataBoundControl)
Site Site Site Site

获取容器信息,该容器在呈现于设计图面上时承载当前控件。Gets information about the container that hosts the current control when rendered on a design surface.

(Inherited from Control)
SkinID SkinID SkinID SkinID

获取或设置要应用于控件的外观。Gets or sets the skin to apply to the control.

(Inherited from WebControl)
Style Style Style Style

获取将在 Web 服务器控件的外部标记上呈现为样式特性的文本特性的集合。Gets a collection of text attributes that will be rendered as a style attribute on the outer tag of the Web server control.

(Inherited from WebControl)
SupportsDisabledAttribute SupportsDisabledAttribute SupportsDisabledAttribute SupportsDisabledAttribute

获取一个值,该值指示在控件的 IsEnabled 属性为 false 时,控件是否应将呈现的 HTML 元素的 disabled 特性设置为 "disabled"。Gets a value that indicates whether the control should set the disabled attribute of the rendered HTML element to "disabled" when the control's IsEnabled property is false.

(Inherited from BaseDataBoundControl)
TabIndex TabIndex TabIndex TabIndex

获取或设置 Web 服务器控件的选项卡索引。Gets or sets the tab index of the Web server control.

(Inherited from WebControl)
TagKey TagKey TagKey TagKey

获取 HtmlTextWriterTag 控件的 DetailsView 值。Gets the HtmlTextWriterTag value for the DetailsView control.

TagName TagName TagName TagName

获取控件标记的名称。Gets the name of the control tag. 此属性主要由控件开发人员使用。This property is used primarily by control developers.

(Inherited from WebControl)
TemplateControl TemplateControl TemplateControl TemplateControl

获取或设置对包含该控件的模板的引用。Gets or sets a reference to the template that contains this control.

(Inherited from Control)
TemplateSourceDirectory TemplateSourceDirectory TemplateSourceDirectory TemplateSourceDirectory

获取包含当前服务器控件的 PageUserControl 的虚拟目录。Gets the virtual directory of the Page or UserControl that contains the current server control.

(Inherited from Control)
ToolTip ToolTip ToolTip ToolTip

获取或设置当鼠标指针悬停在 Web 服务器控件上时显示的文本。Gets or sets the text displayed when the mouse pointer hovers over the Web server control.

(Inherited from WebControl)
TopPagerRow TopPagerRow TopPagerRow TopPagerRow

获取一个 DetailsViewRow 对象,该对象表示 DetailsView 控件中的顶部页导航行。Gets a DetailsViewRow object that represents the top pager row in a DetailsView control.

UniqueID UniqueID UniqueID UniqueID

获取服务器控件的唯一的、以分层形式限定的标识符。Gets the unique, hierarchically qualified identifier for the server control.

(Inherited from Control)
UpdateMethod UpdateMethod UpdateMethod UpdateMethod

获取或设置控件执行更新操作时调用的页面上的方法的名称。Gets or sets the name of the method on the page that is called when the control performs an update operation.

ValidateRequestMode ValidateRequestMode ValidateRequestMode ValidateRequestMode

获取或设置指示控件是否检查来自浏览器的客户端输入是否具有潜在危险值的值。Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values.

(Inherited from Control)
ViewState ViewState ViewState ViewState

获取状态信息的字典,这些信息使您可以在同一页的多个请求间保存和还原服务器控件的视图状态。Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page.

(Inherited from Control)
ViewStateIgnoresCase ViewStateIgnoresCase ViewStateIgnoresCase ViewStateIgnoresCase

获取一个值,该值指示 StateBag 对象是否不区分大小写。Gets a value that indicates whether the StateBag object is case-insensitive.

(Inherited from Control)
ViewStateMode ViewStateMode ViewStateMode ViewStateMode

获取或设置此控件的视图状态模式。Gets or sets the view-state mode of this control.

(Inherited from Control)
Visible Visible Visible Visible

获取或设置一个值,该值指示服务器控件是否作为 UI 呈现在页上。Gets or sets a value that indicates whether a server control is rendered as UI on the page.

(Inherited from Control)
Width Width Width Width

获取或设置 Web 服务器控件的宽度。Gets or sets the width of the Web server control.

(Inherited from WebControl)

方法

AddAttributesToRender(HtmlTextWriter) AddAttributesToRender(HtmlTextWriter) AddAttributesToRender(HtmlTextWriter) AddAttributesToRender(HtmlTextWriter)

将需要呈现的 HTML 特性和样式添加到指定的 HtmlTextWriterTag 中。Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(Inherited from WebControl)
AddedControl(Control, Int32) AddedControl(Control, Int32) AddedControl(Control, Int32) AddedControl(Control, Int32)

在子控件添加到 Control 对象的 Controls 集合后调用。Called after a child control is added to the Controls collection of the Control object.

(Inherited from Control)
AddParsedSubObject(Object) AddParsedSubObject(Object) AddParsedSubObject(Object) AddParsedSubObject(Object)

通知服务器控件,分析了一个元素(XML 或 HTML),并将该元素添加到服务器控件的 ControlCollection 对象中。Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object.

(Inherited from Control)
ApplyStyle(Style) ApplyStyle(Style) ApplyStyle(Style) ApplyStyle(Style)

将指定样式的所有非空白元素复制到 Web 控件,覆盖控件的所有现有的样式元素。Copies any nonblank elements of the specified style to the Web control, overwriting any existing style elements of the control. 此方法主要由控件开发人员使用。This method is primarily used by control developers.

(Inherited from WebControl)
ApplyStyleSheetSkin(Page) ApplyStyleSheetSkin(Page) ApplyStyleSheetSkin(Page) ApplyStyleSheetSkin(Page)

将页样式表中定义的样式属性应用到控件。Applies the style properties defined in the page style sheet to the control.

(Inherited from Control)
BeginRenderTracing(TextWriter, Object) BeginRenderTracing(TextWriter, Object) BeginRenderTracing(TextWriter, Object) BeginRenderTracing(TextWriter, Object)

开始输出数据的设计时追踪。Begins design-time tracing of rendering data.

(Inherited from Control)
BuildProfileTree(String, Boolean) BuildProfileTree(String, Boolean) BuildProfileTree(String, Boolean) BuildProfileTree(String, Boolean)

收集有关服务器控件的信息并将该信息发送到 Trace 属性,在启用页的跟踪功能时将显示该属性。Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page.

(Inherited from Control)
ChangeMode(DetailsViewMode) ChangeMode(DetailsViewMode) ChangeMode(DetailsViewMode) ChangeMode(DetailsViewMode)

DetailsView 控件切换为指定模式。Switches the DetailsView control to the specified mode.

ClearCachedClientID() ClearCachedClientID() ClearCachedClientID() ClearCachedClientID()

将缓存的 ClientID 值设置为 nullSets the cached ClientID value to null.

(Inherited from Control)
ClearChildControlState() ClearChildControlState() ClearChildControlState() ClearChildControlState()

删除服务器控件的子控件的控件状态信息。Deletes the control-state information for the server control's child controls.

(Inherited from Control)
ClearChildState() ClearChildState() ClearChildState() ClearChildState()

删除服务器控件的所有子控件的视图状态和控件状态信息。Deletes the view-state and control-state information for all the server control's child controls.

(Inherited from Control)
ClearChildViewState() ClearChildViewState() ClearChildViewState() ClearChildViewState()

删除服务器控件的所有子控件的视图状态信息。Deletes the view-state information for all the server control's child controls.

(Inherited from Control)
ClearEffectiveClientIDMode() ClearEffectiveClientIDMode() ClearEffectiveClientIDMode() ClearEffectiveClientIDMode()

将当前控件实例和任何子控件的 ClientIDMode 属性设置为 InheritSets the ClientIDMode property of the current control instance and of any child controls to Inherit.

(Inherited from Control)
ConfirmInitState() ConfirmInitState() ConfirmInitState() ConfirmInitState()

设置数据绑定控件的初始化状态。Sets the initialized state of the data-bound control.

(Inherited from BaseDataBoundControl)
CopyBaseAttributes(WebControl) CopyBaseAttributes(WebControl) CopyBaseAttributes(WebControl) CopyBaseAttributes(WebControl)

Style 对象未封装的属性从指定的 Web 服务器控件复制到从中调用此方法的 Web 服务器控件。Copies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(Inherited from WebControl)
CreateAutoGeneratedRow(AutoGeneratedFieldProperties) CreateAutoGeneratedRow(AutoGeneratedFieldProperties) CreateAutoGeneratedRow(AutoGeneratedFieldProperties) CreateAutoGeneratedRow(AutoGeneratedFieldProperties)

创建一个 AutoGeneratedField 对象,该对象表示使用指定的字段属性自动生成的行字段。Creates an AutoGeneratedField object that represents an automatically generated row field using the specified field properties.

CreateAutoGeneratedRows(Object) CreateAutoGeneratedRows(Object) CreateAutoGeneratedRows(Object) CreateAutoGeneratedRows(Object)

创建一组对指定数据项自动生成的行字段。Creates a set of automatically generated row fields for the specified data item.

CreateChildControls() CreateChildControls() CreateChildControls() CreateChildControls()

基于存储在视图状态中的值创建用来呈现复合数据绑定控件的控件层次结构。Creates the control hierarchy that is used to render a composite data-bound control based on the values that are stored in view state.

(Inherited from CompositeDataBoundControl)
CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean) CreateChildControls(IEnumerable, Boolean)

创建用于呈现 DetailsView 控件的控件层次结构。Creates the control hierarchy used to render the DetailsView control.

CreateControlCollection() CreateControlCollection() CreateControlCollection() CreateControlCollection()

创建一个新 ControlCollection 对象来保存服务器控件的子控件(包括文本控件和服务器控件)。Creates a new ControlCollection object to hold the child controls (both literal and server) of the server control.

(Inherited from Control)
CreateControlStyle() CreateControlStyle() CreateControlStyle() CreateControlStyle()

创建 DetailsView 控件的默认表样式对象。Creates a default table style object for the DetailsView control.

CreateDataSourceSelectArguments() CreateDataSourceSelectArguments() CreateDataSourceSelectArguments() CreateDataSourceSelectArguments()

创建传递给“Select”命令的 DataSourceSelectArguments 对象。Creates the DataSourceSelectArguments object that gets passed to the Select command.

CreateFieldSet(Object, Boolean) CreateFieldSet(Object, Boolean) CreateFieldSet(Object, Boolean) CreateFieldSet(Object, Boolean)

创建用来生成控件层次结构的自动生成行字段和用户定义行字段的完整集合。Creates the complete set of automatically generated and user-defined row fields used to generate the control hierarchy.

CreateRow(Int32, DataControlRowType, DataControlRowState) CreateRow(Int32, DataControlRowType, DataControlRowState) CreateRow(Int32, DataControlRowType, DataControlRowState) CreateRow(Int32, DataControlRowType, DataControlRowState)

使用指定项索引、行类型和行状态创建 DetailsViewRow 对象。Creates a DetailsViewRow object using the specified item index, row type, and row state.

CreateTable() CreateTable() CreateTable() CreateTable()

DetailsView 控件创建包含表。Creates the containing table for the DetailsView control.

DataBind() DataBind() DataBind() DataBind()

调用基类的 DataBind() 方法。Calls the DataBind() method of the base class.

DataBind(Boolean) DataBind(Boolean) DataBind(Boolean) DataBind(Boolean)

将数据源绑定到调用的服务器控件及其所有子控件,同时可以选择引发 DataBinding 事件。Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event.

(Inherited from Control)
DataBindChildren() DataBindChildren() DataBindChildren() DataBindChildren()

将数据源绑定到服务器控件的子控件。Binds a data source to the server control's child controls.

(Inherited from Control)
DeleteItem() DeleteItem() DeleteItem() DeleteItem()

从数据源中删除当前记录。Deletes the current record from the data source.

Dispose() Dispose() Dispose() Dispose()

使服务器控件得以在从内存中释放之前执行最后的清理操作。Enables a server control to perform final clean up before it is released from memory.

(Inherited from Control)
EndRenderTracing(TextWriter, Object) EndRenderTracing(TextWriter, Object) EndRenderTracing(TextWriter, Object) EndRenderTracing(TextWriter, Object)

结束输出数据的设计时追踪。Ends design-time tracing of rendering data.

(Inherited from Control)
EnsureChildControls() EnsureChildControls() EnsureChildControls() EnsureChildControls()

确定服务器控件是否包含子控件。Determines whether the server control contains child controls. 如果不包含,则创建子控件。If it does not, it creates child controls.

(Inherited from Control)
EnsureDataBound() EnsureDataBound() EnsureDataBound() EnsureDataBound()

在验证数据列表控件需要数据绑定以及有效数据源控件已指定之后,调用 DataBind() 方法。Calls the DataBind() method after verifying that the data listing control requires data binding and that a valid data source control is specified.

EnsureID() EnsureID() EnsureID() EnsureID()

为尚未分配标识符的控件创建标识符。Creates an identifier for controls that do not have an identifier assigned.

(Inherited from Control)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExtractRowValues(IOrderedDictionary, Boolean, Boolean) ExtractRowValues(IOrderedDictionary, Boolean, Boolean) ExtractRowValues(IOrderedDictionary, Boolean, Boolean) ExtractRowValues(IOrderedDictionary, Boolean, Boolean)

检索显示的每个字段的值,并将它们存储在指定的 IOrderedDictionary 对象中。Retrieves the values of each field displayed and stores them in the specified IOrderedDictionary object.

FindControl(String) FindControl(String) FindControl(String) FindControl(String)

在当前的命名容器中搜索带指定 id 参数的服务器控件。Searches the current naming container for a server control with the specified id parameter.

(Inherited from Control)
FindControl(String, Int32) FindControl(String, Int32) FindControl(String, Int32) FindControl(String, Int32)

使用指定的 idpathOffset 参数(该参数有助于搜索)中指定的整数在当前命名容器中搜索服务器控件。Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. 不应重写此版本的 FindControl 方法。You should not override this version of the FindControl method.

(Inherited from Control)
Focus() Focus() Focus() Focus()

为控件设置输入焦点。Sets input focus to a control.

(Inherited from Control)
GetCallbackResult() GetCallbackResult() GetCallbackResult() GetCallbackResult()

返回以控件为目标的回调事件的结果。Returns the result of a callback event that targets a control.

GetCallbackScript(IButtonControl, String) GetCallbackScript(IButtonControl, String) GetCallbackScript(IButtonControl, String) GetCallbackScript(IButtonControl, String)

返回使用指定的参数创建的回调字符串。Returns the callback string created using the specified argument.

GetData() GetData() GetData() GetData()

检索数据绑定控件用于执行数据操作的 DataSourceView 对象。Retrieves a DataSourceView object that the data-bound control uses to perform data operations.

(Inherited from DataBoundControl)
GetDataSource() GetDataSource() GetDataSource() GetDataSource()

检索与数据绑定控件关联的 IDataSource 接口(如果有)。Retrieves the IDataSource interface that the data-bound control is associated with, if any.

(Inherited from DataBoundControl)
GetDesignModeState() GetDesignModeState() GetDesignModeState() GetDesignModeState()

获取控件的设计时数据。Gets design-time data for a control.

(Inherited from Control)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetRouteUrl(Object) GetRouteUrl(Object) GetRouteUrl(Object) GetRouteUrl(Object)

获取与一组路由参数对应的 URL。Gets the URL that corresponds to a set of route parameters.

(Inherited from Control)
GetRouteUrl(RouteValueDictionary) GetRouteUrl(RouteValueDictionary) GetRouteUrl(RouteValueDictionary) GetRouteUrl(RouteValueDictionary)

获取与一组路由参数对应的 URL。Gets the URL that corresponds to a set of route parameters.

(Inherited from Control)
GetRouteUrl(String, Object) GetRouteUrl(String, Object) GetRouteUrl(String, Object) GetRouteUrl(String, Object)

获取与一组路由参数以及某个路由名称对应的 URL。Gets the URL that corresponds to a set of route parameters and a route name.

(Inherited from Control)
GetRouteUrl(String, RouteValueDictionary) GetRouteUrl(String, RouteValueDictionary) GetRouteUrl(String, RouteValueDictionary) GetRouteUrl(String, RouteValueDictionary)

获取与一组路由参数以及某个路由名称对应的 URL。Gets the URL that corresponds to a set of route parameters and a route name.

(Inherited from Control)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
GetUniqueIDRelativeTo(Control) GetUniqueIDRelativeTo(Control) GetUniqueIDRelativeTo(Control) GetUniqueIDRelativeTo(Control)

返回指定控件的 UniqueID 属性的前缀部分。Returns the prefixed portion of the UniqueID property of the specified control.

(Inherited from Control)
HasControls() HasControls() HasControls() HasControls()

确定服务器控件是否包含任何子控件。Determines if the server control contains any child controls.

(Inherited from Control)
HasEvents() HasEvents() HasEvents() HasEvents()

返回一个值,该值指示是否为控件或任何子控件注册事件。Returns a value indicating whether events are registered for the control or any child controls.

(Inherited from Control)
InitializePager(DetailsViewRow, PagedDataSource) InitializePager(DetailsViewRow, PagedDataSource) InitializePager(DetailsViewRow, PagedDataSource) InitializePager(DetailsViewRow, PagedDataSource)

DetailsView 控件创建页导航行。Creates the pager row for the DetailsView control.

InitializeRow(DetailsViewRow, DataControlField) InitializeRow(DetailsViewRow, DataControlField) InitializeRow(DetailsViewRow, DataControlField) InitializeRow(DetailsViewRow, DataControlField)

初始化指定的 DetailsViewRow 对象。Initializes the specified DetailsViewRow object.

InsertItem(Boolean) InsertItem(Boolean) InsertItem(Boolean) InsertItem(Boolean)

将当前记录插入到数据源中。Inserts the current record in the data source.

IsBindableType(Type) IsBindableType(Type) IsBindableType(Type) IsBindableType(Type)

确定指定的数据类型是否可以绑定到 DetailsView 控件中的字段。Determines whether the specified data type can be bound to a field in the DetailsView control.

IsLiteralContent() IsLiteralContent() IsLiteralContent() IsLiteralContent()

确定服务器控件是否只包含文字内容。Determines if the server control holds only literal content.

(Inherited from Control)
LoadControlState(Object) LoadControlState(Object) LoadControlState(Object) LoadControlState(Object)

加载 DetailsView 控件中需要保留的属性的状态(即使在 EnableViewState 属性设置为 false 时)。Loads the state of the properties in the DetailsView control that need to be persisted, even when the EnableViewState property is set to false.

LoadViewState(Object) LoadViewState(Object) LoadViewState(Object) LoadViewState(Object)

加载以前保存的 DetailsView 控件的视图状态。Loads the previously saved view state of the DetailsView control.

MapPathSecure(String) MapPathSecure(String) MapPathSecure(String) MapPathSecure(String)

检索虚拟路径(绝对的或相对的)映射到的物理路径。Retrieves the physical path that a virtual path, either absolute or relative, maps to.

(Inherited from Control)
MarkAsDataBound() MarkAsDataBound() MarkAsDataBound() MarkAsDataBound()

将视图状态中的控件状态设置为成功绑定到数据。Sets the state of the control in view state as successfully bound to data.

(Inherited from DataBoundControl)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
MergeStyle(Style) MergeStyle(Style) MergeStyle(Style) MergeStyle(Style)

将指定样式的所有非空白元素复制到 Web 控件,但不覆盖该控件现有的任何样式元素。Copies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(Inherited from WebControl)
OnBubbleEvent(Object, EventArgs) OnBubbleEvent(Object, EventArgs) OnBubbleEvent(Object, EventArgs) OnBubbleEvent(Object, EventArgs)

确定 Web 服务器控件的事件是否沿页的用户界面 (UI) 服务器控件层次结构向上传递。Determines whether the event for the Web server control is passed up the page's user interface (UI) server control hierarchy.

OnCreatingModelDataSource(CreatingModelDataSourceEventArgs) OnCreatingModelDataSource(CreatingModelDataSourceEventArgs) OnCreatingModelDataSource(CreatingModelDataSourceEventArgs) OnCreatingModelDataSource(CreatingModelDataSourceEventArgs)

引发 CreatingModelDataSource 事件。Raises the CreatingModelDataSource event.

(Inherited from DataBoundControl)
OnDataBinding(EventArgs) OnDataBinding(EventArgs) OnDataBinding(EventArgs) OnDataBinding(EventArgs)

引发 DataBinding 事件。Raises the DataBinding event.

(Inherited from Control)
OnDataBound(EventArgs) OnDataBound(EventArgs) OnDataBound(EventArgs) OnDataBound(EventArgs)

引发 DataBound 事件。Raises the DataBound event.

(Inherited from BaseDataBoundControl)
OnDataPropertyChanged() OnDataPropertyChanged() OnDataPropertyChanged() OnDataPropertyChanged()

在某一基数据源标识属性更改后,将数据绑定控件重新绑定到其数据。Rebinds the data-bound control to its data after one of the base data source identification properties changes.

(Inherited from DataBoundControl)
OnDataSourceViewChanged(Object, EventArgs) OnDataSourceViewChanged(Object, EventArgs) OnDataSourceViewChanged(Object, EventArgs) OnDataSourceViewChanged(Object, EventArgs)

引发 DataSourceViewChanged 事件。Raises the DataSourceViewChanged event.

OnInit(EventArgs) OnInit(EventArgs) OnInit(EventArgs) OnInit(EventArgs)

引发 Init 事件。Raises the Init event.

OnItemCommand(DetailsViewCommandEventArgs) OnItemCommand(DetailsViewCommandEventArgs) OnItemCommand(DetailsViewCommandEventArgs) OnItemCommand(DetailsViewCommandEventArgs)

引发 ItemCommand 事件。Raises the ItemCommand event.

OnItemCreated(EventArgs) OnItemCreated(EventArgs) OnItemCreated(EventArgs) OnItemCreated(EventArgs)

引发 ItemCreated 事件。Raises the ItemCreated event.

OnItemDeleted(DetailsViewDeletedEventArgs) OnItemDeleted(DetailsViewDeletedEventArgs) OnItemDeleted(DetailsViewDeletedEventArgs) OnItemDeleted(DetailsViewDeletedEventArgs)

引发 ItemDeleted 事件。Raises the ItemDeleted event.

OnItemDeleting(DetailsViewDeleteEventArgs) OnItemDeleting(DetailsViewDeleteEventArgs) OnItemDeleting(DetailsViewDeleteEventArgs) OnItemDeleting(DetailsViewDeleteEventArgs)

引发 ItemDeleting 事件。Raises the ItemDeleting event.

OnItemInserted(DetailsViewInsertedEventArgs) OnItemInserted(DetailsViewInsertedEventArgs) OnItemInserted(DetailsViewInsertedEventArgs) OnItemInserted(DetailsViewInsertedEventArgs)

引发 ItemInserted 事件。Raises the ItemInserted event.

OnItemInserting(DetailsViewInsertEventArgs) OnItemInserting(DetailsViewInsertEventArgs) OnItemInserting(DetailsViewInsertEventArgs) OnItemInserting(DetailsViewInsertEventArgs)

引发 ItemInserting 事件。Raises the ItemInserting event.

OnItemUpdated(DetailsViewUpdatedEventArgs) OnItemUpdated(DetailsViewUpdatedEventArgs) OnItemUpdated(DetailsViewUpdatedEventArgs) OnItemUpdated(DetailsViewUpdatedEventArgs)

引发 ItemUpdated 事件。Raises the ItemUpdated event.

OnItemUpdating(DetailsViewUpdateEventArgs) OnItemUpdating(DetailsViewUpdateEventArgs) OnItemUpdating(DetailsViewUpdateEventArgs) OnItemUpdating(DetailsViewUpdateEventArgs)

引发 ItemUpdating 事件。Raises the ItemUpdating event.

OnLoad(EventArgs) OnLoad(EventArgs) OnLoad(EventArgs) OnLoad(EventArgs)

处理 Load 事件。Handles the Load event.

(Inherited from DataBoundControl)
OnModeChanged(EventArgs) OnModeChanged(EventArgs) OnModeChanged(EventArgs) OnModeChanged(EventArgs)

引发 ModeChanged 事件。Raises the ModeChanged event.

OnModeChanging(DetailsViewModeEventArgs) OnModeChanging(DetailsViewModeEventArgs) OnModeChanging(DetailsViewModeEventArgs) OnModeChanging(DetailsViewModeEventArgs)

引发 ModeChanging 事件。Raises the ModeChanging event.

OnPageIndexChanged(EventArgs) OnPageIndexChanged(EventArgs) OnPageIndexChanged(EventArgs) OnPageIndexChanged(EventArgs)

引发 PageIndexChanged 事件。Raises the PageIndexChanged event.

OnPageIndexChanging(DetailsViewPageEventArgs) OnPageIndexChanging(DetailsViewPageEventArgs) OnPageIndexChanging(DetailsViewPageEventArgs) OnPageIndexChanging(DetailsViewPageEventArgs)

引发 PageIndexChanging 事件。Raises the PageIndexChanging event.

OnPagePreLoad(Object, EventArgs) OnPagePreLoad(Object, EventArgs) OnPagePreLoad(Object, EventArgs) OnPagePreLoad(Object, EventArgs)

在加载数据绑定控件之前设置该控件的初始化状态。Sets the initialized state of the data-bound control before the control is loaded.

OnPreRender(EventArgs) OnPreRender(EventArgs) OnPreRender(EventArgs) OnPreRender(EventArgs)

引发 PreRender 事件。Raises the PreRender event.

OnUnload(EventArgs) OnUnload(EventArgs) OnUnload(EventArgs) OnUnload(EventArgs)

引发 Unload 事件。Raises the Unload event.

(Inherited from Control)
OpenFile(String) OpenFile(String) OpenFile(String) OpenFile(String)

获取用于读取文件的 StreamGets a Stream used to read a file.

(Inherited from Control)
PerformDataBinding(IEnumerable) PerformDataBinding(IEnumerable) PerformDataBinding(IEnumerable) PerformDataBinding(IEnumerable)

将指定数据源绑定到 DetailsView 控件。Binds the specified data source to the DetailsView control.

PerformSelect() PerformSelect() PerformSelect() PerformSelect()

从关联的数据源中检索数据。Retrieves data from the associated data source.

(Inherited from DataBoundControl)
PrepareControlHierarchy() PrepareControlHierarchy() PrepareControlHierarchy() PrepareControlHierarchy()

设置 DetailsView 控件的控件层次结构。Sets up the control hierarchy of the DetailsView control.

RaiseBubbleEvent(Object, EventArgs) RaiseBubbleEvent(Object, EventArgs) RaiseBubbleEvent(Object, EventArgs) RaiseBubbleEvent(Object, EventArgs)

将所有事件源及其信息分配给控件的父级。Assigns any sources of the event and its information to the control's parent.

(Inherited from Control)
RaiseCallbackEvent(String) RaiseCallbackEvent(String) RaiseCallbackEvent(String) RaiseCallbackEvent(String)

GetCallbackEventReference 方法中的回调处理程序创建参数。Creates the arguments for the callback handler in the GetCallbackEventReference method.

RaisePostBackEvent(String) RaisePostBackEvent(String) RaisePostBackEvent(String) RaisePostBackEvent(String)

DetailsView 控件回发到服务器时引发此控件的合适的事件。Raises the appropriate events for the DetailsView control when it posts back to the server.

RemovedControl(Control) RemovedControl(Control) RemovedControl(Control) RemovedControl(Control)

Control 对象的 Controls 集合移除子控件后调用。Called after a child control is removed from the Controls collection of the Control object.

(Inherited from Control)
Render(HtmlTextWriter) Render(HtmlTextWriter) Render(HtmlTextWriter) Render(HtmlTextWriter)

使用指定的 DetailsView 对象在客户端上显示 HtmlTextWriter 控件。Displays the DetailsView control on the client using the specified HtmlTextWriter object.

RenderBeginTag(HtmlTextWriter) RenderBeginTag(HtmlTextWriter) RenderBeginTag(HtmlTextWriter) RenderBeginTag(HtmlTextWriter)

将控件的 HTML 开始标记呈现到指定的编写器中。Renders the HTML opening tag of the control to the specified writer. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(Inherited from WebControl)
RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter) RenderChildren(HtmlTextWriter)

将服务器控件子级的内容输出到提供的 HtmlTextWriter 对象,此对象编写将在客户端呈现的内容。Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(Inherited from Control)
RenderContents(HtmlTextWriter) RenderContents(HtmlTextWriter) RenderContents(HtmlTextWriter) RenderContents(HtmlTextWriter)

将控件的内容呈现到指定的编写器中。Renders the contents of the control to the specified writer. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(Inherited from WebControl)
RenderControl(HtmlTextWriter) RenderControl(HtmlTextWriter) RenderControl(HtmlTextWriter) RenderControl(HtmlTextWriter)

将服务器控件内容输出到所提供的 HtmlTextWriter 对象,如果启用了跟踪,则还将存储有关该控件的跟踪信息。Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

(Inherited from Control)
RenderControl(HtmlTextWriter, ControlAdapter) RenderControl(HtmlTextWriter, ControlAdapter) RenderControl(HtmlTextWriter, ControlAdapter) RenderControl(HtmlTextWriter, ControlAdapter)

使用提供的 HtmlTextWriter 对象将服务器控件内容输出到提供的 ControlAdapter 对象。Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object.

(Inherited from Control)
RenderEndTag(HtmlTextWriter) RenderEndTag(HtmlTextWriter) RenderEndTag(HtmlTextWriter) RenderEndTag(HtmlTextWriter)

将控件的 HTML 结束标记呈现到指定的编写器中。Renders the HTML closing tag of the control into the specified writer. 此方法主要由控件开发人员使用。This method is used primarily by control developers.

(Inherited from WebControl)
ResolveAdapter() ResolveAdapter() ResolveAdapter() ResolveAdapter()

获取负责呈现指定控件的控件适配器。Gets the control adapter responsible for rendering the specified control.

(Inherited from Control)
ResolveClientUrl(String) ResolveClientUrl(String) ResolveClientUrl(String) ResolveClientUrl(String)

获取浏览器可以使用的 URL。Gets a URL that can be used by the browser.

(Inherited from Control)
ResolveUrl(String) ResolveUrl(String) ResolveUrl(String) ResolveUrl(String)

将 URL 转换为在请求客户端可用的 URL。Converts a URL into one that is usable on the requesting client.

(Inherited from Control)
SaveControlState() SaveControlState() SaveControlState() SaveControlState()

保存 DetailsView 控件中需要保留的属性的状态(即使在 EnableViewState 属性设置为 false 时)。Saves the state of the properties in the DetailsView control that need to be persisted, even when the EnableViewState property is set to false.

SaveViewState() SaveViewState() SaveViewState() SaveViewState()

保存 DetailsView 控件的当前视图状态。Saves the current view state of the DetailsView control.

SetDesignModeState(IDictionary) SetDesignModeState(IDictionary) SetDesignModeState(IDictionary) SetDesignModeState(IDictionary)

为控件设置设计时数据。Sets design-time data for a control.

(Inherited from Control)
SetPageIndex(Int32) SetPageIndex(Int32) SetPageIndex(Int32) SetPageIndex(Int32)

设置 DetailsView 控件中当前显示页面的索引。Sets the index of the currently displayed page in the DetailsView control.

SetRenderMethodDelegate(RenderMethod) SetRenderMethodDelegate(RenderMethod) SetRenderMethodDelegate(RenderMethod) SetRenderMethodDelegate(RenderMethod)

分配事件处理程序委托,以将服务器控件及其内容呈现到父控件中。Assigns an event handler delegate to render the server control and its content into its parent control.

(Inherited from Control)
SetTraceData(Object, Object) SetTraceData(Object, Object) SetTraceData(Object, Object) SetTraceData(Object, Object)

使用跟踪数据键和跟踪数据值,为呈现数据的设计时追踪设置跟踪数据。Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value.

(Inherited from Control)
SetTraceData(Object, Object, Object) SetTraceData(Object, Object, Object) SetTraceData(Object, Object, Object) SetTraceData(Object, Object, Object)

使用跟踪对象、跟踪数据键和跟踪数据值,为呈现数据的设计时追踪设置跟踪数据。Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value.

(Inherited from Control)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
TrackViewState() TrackViewState() TrackViewState() TrackViewState()

标记开始跟踪并对 DetailsView 控件的视图状态更改进行保存的起始点。Marks the starting point to begin tracking and saving view-state changes to the DetailsView control.

UpdateItem(Boolean) UpdateItem(Boolean) UpdateItem(Boolean) UpdateItem(Boolean)

更新数据源中的当前记录。Updates the current record in the data source.

ValidateDataSource(Object) ValidateDataSource(Object) ValidateDataSource(Object) ValidateDataSource(Object)

验证数据绑定控件绑定到的对象是否可以和该控件一同使用。Verifies that the object a data-bound control binds to is one it can work with.

(Inherited from DataBoundControl)

事件

CallingDataMethods CallingDataMethods CallingDataMethods CallingDataMethods

在数据方法正被调用时发生。Occurs when data methods are being called.

(Inherited from DataBoundControl)
CreatingModelDataSource CreatingModelDataSource CreatingModelDataSource CreatingModelDataSource

ModelDataSource 对象正被创建时发生。Occurs when the ModelDataSource object is being created.

(Inherited from DataBoundControl)
DataBinding DataBinding DataBinding DataBinding

当服务器控件绑定到数据源时发生。Occurs when the server control binds to a data source.

(Inherited from Control)
DataBound DataBound DataBound DataBound

在服务器控件绑定到数据源后发生。Occurs after the server control binds to a data source.

(Inherited from BaseDataBoundControl)
Disposed Disposed Disposed Disposed

当从内存释放服务器控件时发生,这是请求 ASP.NET 页时服务器控件生存期的最后阶段。Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

(Inherited from Control)
Init Init Init Init

当服务器控件初始化时发生;初始化是控件生存期的第一步。Occurs when the server control is initialized, which is the first step in its lifecycle.

(Inherited from Control)
ItemCommand ItemCommand ItemCommand ItemCommand

在单击 DetailsView 控件中的某个按钮时发生。Occurs when a button within a DetailsView control is clicked.

ItemCreated ItemCreated ItemCreated ItemCreated

DetailsView 控件中创建记录时发生。Occurs when a record is created in a DetailsView control.

ItemDeleted ItemDeleted ItemDeleted ItemDeleted

在单击 DetailsView 控件中的“删除”按钮时,但在删除操作之后发生。Occurs when a Delete button within a DetailsView control is clicked, but after the delete operation.

ItemDeleting ItemDeleting ItemDeleting ItemDeleting

在单击 DetailsView 控件中的“删除”按钮时,但在删除操作之前发生。Occurs when a Delete button within a DetailsView control is clicked, but before the delete operation.

ItemInserted ItemInserted ItemInserted ItemInserted

在单击 DetailsView 控件中的“插入”按钮时,但在插入操作之后发生。Occurs when an Insert button within a DetailsView control is clicked, but after the insert operation.

ItemInserting ItemInserting ItemInserting ItemInserting

在单击 DetailsView 控件中的“插入”按钮时,但在插入操作之前发生。Occurs when an Insert button within a DetailsView control is clicked, but before the insert operation.

ItemUpdated ItemUpdated ItemUpdated ItemUpdated

在单击 DetailsView 控件中的“更新”按钮时,但在更新操作之后发生。Occurs when an Update button within a DetailsView control is clicked, but after the update operation.

ItemUpdating ItemUpdating ItemUpdating ItemUpdating

在单击 DetailsView 控件中的“更新”按钮时,但在更新操作之前发生。Occurs when an Update button within a DetailsView control is clicked, but before the update operation.

Load Load Load Load

当服务器控件加载到 Page 对象中时发生。Occurs when the server control is loaded into the Page object.

(Inherited from Control)
ModeChanged ModeChanged ModeChanged ModeChanged

DetailsView 控件尝试在编辑、插入和只读模式之间更改时,但在更新 CurrentMode 属性之后发生。Occurs when a DetailsView control attempts to change between edit, insert, and read-only mode, but after the CurrentMode property is updated.

ModeChanging ModeChanging ModeChanging ModeChanging

DetailsView 控件尝试在编辑、插入和只读模式之间更改时,但在更新 CurrentMode 属性之前发生。Occurs when a DetailsView control attempts to change between edit, insert, and read-only mode, but before the CurrentMode property is updated.

PageIndexChanged PageIndexChanged PageIndexChanged PageIndexChanged

PageIndex 属性的值在分页操作后更改时发生。Occurs when the value of the PageIndex property changes after a paging operation.

PageIndexChanging PageIndexChanging PageIndexChanging PageIndexChanging

PageIndex 属性的值在分页操作前更改时发生。Occurs when the value of the PageIndex property changes before a paging operation.

PreRender PreRender PreRender PreRender

在加载 Control 对象之后、呈现之前发生。Occurs after the Control object is loaded but prior to rendering.

(Inherited from Control)
Unload Unload Unload Unload

当服务器控件从内存中卸载时发生。Occurs when the server control is unloaded from memory.

(Inherited from Control)

显式界面实现

IAttributeAccessor.GetAttribute(String) IAttributeAccessor.GetAttribute(String) IAttributeAccessor.GetAttribute(String) IAttributeAccessor.GetAttribute(String)

获取具有指定名称的 Web 控件的特性。Gets an attribute of the Web control with the specified name.

(Inherited from WebControl)
IAttributeAccessor.SetAttribute(String, String) IAttributeAccessor.SetAttribute(String, String) IAttributeAccessor.SetAttribute(String, String) IAttributeAccessor.SetAttribute(String, String)

将 Web 控件的特性设置为指定的名称和值。Sets an attribute of the Web control to the specified name and value.

(Inherited from WebControl)
ICallbackContainer.GetCallbackScript(IButtonControl, String) ICallbackContainer.GetCallbackScript(IButtonControl, String) ICallbackContainer.GetCallbackScript(IButtonControl, String) ICallbackContainer.GetCallbackScript(IButtonControl, String)

DetailsView 控件创建回调脚本。Creates the callback script for the DetailsView control.

ICallbackEventHandler.GetCallbackResult() ICallbackEventHandler.GetCallbackResult() ICallbackEventHandler.GetCallbackResult() ICallbackEventHandler.GetCallbackResult()

请参见 GetCallbackResult() 方法。See the method GetCallbackResult().

ICallbackEventHandler.RaiseCallbackEvent(String) ICallbackEventHandler.RaiseCallbackEvent(String) ICallbackEventHandler.RaiseCallbackEvent(String) ICallbackEventHandler.RaiseCallbackEvent(String)

使用指定参数引发回调事件。Raises the callback event using the specified arguments.

IControlDesignerAccessor.GetDesignModeState() IControlDesignerAccessor.GetDesignModeState() IControlDesignerAccessor.GetDesignModeState() IControlDesignerAccessor.GetDesignModeState()

有关此成员的说明,请参见 GetDesignModeState()For a description of this member, see GetDesignModeState().

(Inherited from Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary) IControlDesignerAccessor.SetDesignModeState(IDictionary) IControlDesignerAccessor.SetDesignModeState(IDictionary) IControlDesignerAccessor.SetDesignModeState(IDictionary)

有关此成员的说明,请参见 SetDesignModeState(IDictionary)For a description of this member, see SetDesignModeState(IDictionary).

(Inherited from Control)
IControlDesignerAccessor.SetOwnerControl(Control) IControlDesignerAccessor.SetOwnerControl(Control) IControlDesignerAccessor.SetOwnerControl(Control) IControlDesignerAccessor.SetOwnerControl(Control)

有关此成员的说明,请参见 SetOwnerControl(Control)For a description of this member, see SetOwnerControl(Control).

(Inherited from Control)
IDataBoundControl.DataKeyNames IDataBoundControl.DataKeyNames IDataBoundControl.DataKeyNames IDataBoundControl.DataKeyNames

有关此属性的说明,请参见 DataKeyNamesFor a description of this property, see DataKeyNames.

IDataBoundControl.DataMember IDataBoundControl.DataMember IDataBoundControl.DataMember IDataBoundControl.DataMember

有关此属性的说明,请参见 DataMemberFor a description of this property, see DataMember.

IDataBoundControl.DataSource IDataBoundControl.DataSource IDataBoundControl.DataSource IDataBoundControl.DataSource

有关此属性的说明,请参见 DataSourceFor a description of this property, see DataSource.

IDataBoundControl.DataSourceID IDataBoundControl.DataSourceID IDataBoundControl.DataSourceID IDataBoundControl.DataSourceID

有关此属性的说明,请参见 DataSourceIDFor a description of this property, see DataSourceID.

IDataBoundControl.DataSourceObject IDataBoundControl.DataSourceObject IDataBoundControl.DataSourceObject IDataBoundControl.DataSourceObject

有关此属性的说明,请参见 DataSourceObjectFor a description of this property, see DataSourceObject.

IDataBoundItemControl.DataKey IDataBoundItemControl.DataKey IDataBoundItemControl.DataKey IDataBoundItemControl.DataKey

有关此属性的说明,请参见 DataKeyFor a description of this property, see DataKey.

IDataBoundItemControl.Mode IDataBoundItemControl.Mode IDataBoundItemControl.Mode IDataBoundItemControl.Mode

有关此属性的说明,请参见 ModeFor a description of this property, see Mode.

IDataItemContainer.DataItemIndex IDataItemContainer.DataItemIndex IDataItemContainer.DataItemIndex IDataItemContainer.DataItemIndex

有关此成员的说明,请参见 DataItemIndexFor a description of this member, see DataItemIndex.

IDataItemContainer.DisplayIndex IDataItemContainer.DisplayIndex IDataItemContainer.DisplayIndex IDataItemContainer.DisplayIndex

有关此成员的说明,请参见 DisplayIndexFor a description of this member, see DisplayIndex.

IFieldControl.FieldsGenerator IFieldControl.FieldsGenerator IFieldControl.FieldsGenerator IFieldControl.FieldsGenerator

有关此属性的说明,请参见 FieldsGeneratorFor a description of this property, see FieldsGenerator.

IParserAccessor.AddParsedSubObject(Object) IParserAccessor.AddParsedSubObject(Object) IParserAccessor.AddParsedSubObject(Object) IParserAccessor.AddParsedSubObject(Object)

有关此成员的说明,请参见 AddParsedSubObject(Object)For a description of this member, see AddParsedSubObject(Object).

(Inherited from Control)
IPostBackContainer.GetPostBackOptions(IButtonControl) IPostBackContainer.GetPostBackOptions(IButtonControl) IPostBackContainer.GetPostBackOptions(IButtonControl) IPostBackContainer.GetPostBackOptions(IButtonControl)

有关此成员的说明,请参见 GetPostBackOptions(IButtonControl)For a description of this member, see GetPostBackOptions(IButtonControl).

IPostBackEventHandler.RaisePostBackEvent(String) IPostBackEventHandler.RaisePostBackEvent(String) IPostBackEventHandler.RaisePostBackEvent(String) IPostBackEventHandler.RaisePostBackEvent(String)

有关此成员的说明,请参见 RaisePostBackEvent(String)For a description of this member, see RaisePostBackEvent(String).

扩展方法

EnablePersistedSelection(BaseDataBoundControl) EnablePersistedSelection(BaseDataBoundControl) EnablePersistedSelection(BaseDataBoundControl) EnablePersistedSelection(BaseDataBoundControl)

使选定内容能够保留在支持选择和分页的数据控件中。Enables selection to be persisted in data controls that support selection and paging.

FindDataSourceControl(Control) FindDataSourceControl(Control) FindDataSourceControl(Control) FindDataSourceControl(Control)

返回与指定控件的数据控件关联的数据源。Returns the data source that is associated with the data control for the specified control.

FindFieldTemplate(Control, String) FindFieldTemplate(Control, String) FindFieldTemplate(Control, String) FindFieldTemplate(Control, String)

返回指定控件的命名容器中指定列的字段模板。Returns the field template for the specified column in the specified control's naming container.

FindMetaTable(Control) FindMetaTable(Control) FindMetaTable(Control) FindMetaTable(Control)

返回包含数据控件的元表对象。Returns the metatable object for the containing data control.

GetDefaultValues(INamingContainer) GetDefaultValues(INamingContainer) GetDefaultValues(INamingContainer) GetDefaultValues(INamingContainer)

为指定数据控件获取默认值的集合。Gets the collection of the default values for the specified data control.

GetMetaTable(INamingContainer) GetMetaTable(INamingContainer) GetMetaTable(INamingContainer) GetMetaTable(INamingContainer)

为指定数据控件获取表元数据。Gets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable) SetMetaTable(INamingContainer, MetaTable) SetMetaTable(INamingContainer, MetaTable) SetMetaTable(INamingContainer, MetaTable)

为指定数据控件设置表元数据。Sets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>) SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>) SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>) SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

为指定数据控件设置表元数据和默认值映射。Sets the table metadata and default value mapping for the specified data control.

SetMetaTable(INamingContainer, MetaTable, Object) SetMetaTable(INamingContainer, MetaTable, Object) SetMetaTable(INamingContainer, MetaTable, Object) SetMetaTable(INamingContainer, MetaTable, Object)

为指定数据控件设置表元数据和默认值映射。Sets the table metadata and default value mapping for the specified data control.

TryGetMetaTable(INamingContainer, MetaTable) TryGetMetaTable(INamingContainer, MetaTable) TryGetMetaTable(INamingContainer, MetaTable) TryGetMetaTable(INamingContainer, MetaTable)

确定表元数据是否可用。Determines whether table metadata is available.

EnableDynamicData(INamingContainer, Type) EnableDynamicData(INamingContainer, Type) EnableDynamicData(INamingContainer, Type) EnableDynamicData(INamingContainer, Type)

为指定数据控件启用动态数据行为。Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>) EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>) EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>) EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

为指定数据控件启用动态数据行为。Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, Object) EnableDynamicData(INamingContainer, Type, Object) EnableDynamicData(INamingContainer, Type, Object) EnableDynamicData(INamingContainer, Type, Object)

为指定数据控件启用动态数据行为。Enables Dynamic Data behavior for the specified data control.

适用于

另请参阅