你可以使用e.OldValues
屬性。
<asp:DropDownList ID="esDropDownList" runat="server" DataSourceID="SqlDataSourceddlEnrolmentStatus" DataTextField="EnrolmentStatusDescription" DataValueField="EnrolmentStatusID" SelectedValue='<%# Bind("StudentEnrolmentStatus") %>'>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSourceddlEnrolmentStatus" runat="server"
ConnectionString="<%$ ConnectionStrings:ATCNTV1ConnectionString %>" SelectCommand="SELECT [EnrolmentStatusID], [EnrolmentStatusDescription] FROM [tblEnrolmentStatuses] ORDER BY [EnrolmentStatusID]">
</asp:SqlDataSource>
而且在後面的代碼(假設你的下拉列表是一個FormView)...
protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e)
{
..
String msg = "This is the new value " + e.NewValues["StudentEnrolmentStatus"].ToString()+ " and this is the old value " + e.OldValues["StudentEnrolmentStatus"].ToString();
..
}
感謝您的信息drharris。 – 2011-01-31 01:19:37