请c#.net能人帮我看一下这个页面的程序
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#336666" BorderStyle="Double" DataKeyNames="id"
BorderWidth="1px" CellPadding="4" OnRowCreated="GridView1_RowCreated"
style="font-size: x-small" Width="100%" OnRowDataBound="GridView1_RowDataBound" >
<RowStyle BackColor="White" ForeColor="#333333" />
<Columns>
<asp:TemplateField>
<HeaderStyle Width="10px" />
<ItemTemplate>
<%# Eval("id") %>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="qd_name" HeaderText="qd_name" SortExpression="qd_name" >
<HeaderStyle Width="15%" />
</asp:BoundField>
<asp:BoundField DataField="hd_date" DataFormatString="{0:d}" htmlencode="False" HeaderText="hd_date" SortExpression="hd_date" >
<HeaderStyle Width="10%" />
</asp:BoundField>
<asp:BoundField DataField="hd_place" HeaderText="hd_place" SortExpression="hd_place" >
<HeaderStyle Width="15%" />
</asp:BoundField>
<asp:BoundField DataField="our_contact" HeaderText="our_contact" SortExpression="our_contact" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="his_contact" HeaderText="his_contact" SortExpression="his_contact" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="his_tel" HeaderText="his_tel" SortExpression="his_tel" />
<asp:BoundField DataField="yiji" HeaderText="yiji" SortExpression="yiji" />
<asp:BoundField DataField="huli" HeaderText="huli" SortExpression="huli" />
<asp:BoundField DataField="market" HeaderText="market" SortExpression="market" />
<asp:BoundField DataField="qita" HeaderText="qita" SortExpression="qita" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="total" HeaderText="total" SortExpression="total" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="total_maybe" HeaderText="total_maybe" SortExpression="total_maybe" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:TemplateField HeaderText="dis_type">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>
<asp:HiddenField ID="hfId" runat="server" Value='<%# Eval("Id")%>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderStyle Width="10px" />
<ItemTemplate>
<%=mycount %>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="xuanquance" HeaderText="xuanquance" SortExpression="xuanquance" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="shilibiao" HeaderText="shilibiao" SortExpression="shilibiao" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="shibaoka" HeaderText="shibaoka" SortExpression="shibaoka" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="yuyuejieche" HeaderText="yuyuejieche" SortExpression="yuyuejieche" >
<HeaderStyle Width="5%" />
</asp:BoundField>
<asp:BoundField DataField="jmdj" HeaderText="jmdj" SortExpression="jmdj" >
<HeaderStyle Width="5%" />
</asp:BoundField>
</Columns>
<PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White"
HorizontalAlign="Left" />
<HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
</asp:GridView>
---------------------------------------
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
HiddenField hf =(HiddenField) e.Row.FindControl("hfId");
if ((DropDownList)e.Row.FindControl("DropDownList1") != null)
{
SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);
con.Open();
DropDownList DropDownList1 = (DropDownList)e.Row.FindControl("DropDownList1");
string sql = "SELECT * FROM shichan_dis where hd_id="+hf.Value;
Session["hdid"] = hf.Value;
SqlDataAdapter adapter = new SqlDataAdapter(sql, con);
DataSet dataset = new DataSet();
con.Close();
adapter.Fill(dataset);
DropDownList1.DataSource = dataset;
DropDownList1.DataTextField = "dis_type";
DropDownList1.DataValueField = "hd_id";
DropDownList1.DataBind();
}
}
public void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList DropDownList1 = sender as DropDownList;
int index = (DropDownList1.NamingContainer as GridViewRow).RowIndex;
string id = GridView1.DataKeys[index].Value.ToString();
string sql = "SELECT * FROM shichan_hd INNER JOIN shichan_dis ON shichan_dis.hd_id = shichan_hd.id where shichan_hd.id=" + id;
DataTable dt = Class1.ExecSel(sql);
mycount = dt.Rows[0]["dis_count"].ToString();
}
怎么触发不了这个public void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
事件啊