如果想在点击GridView中一行时,触发onselectedindexchanged事件 ,必须在 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderWidth="0px"
AllowPaging="true" PageSize="20" AutoGenerateSelectButton="true"
CaptionAlign="Top" CellPadding="0" CellSpacing="1" DataKeyNames="ID"
Width="100%" onrowcreated="GridView1_RowCreated"
onrowdatabound="GridView1_RowDataBound"
onselectedindexchanged="GridView1_SelectedIndexChanged"
onpageindexchanging="GridView1_PageIndexChanging">
中加入 :AutoGenerateSelectButton="true"