Gridview里有Button控件,为什么点击没反映,也不报错。设置断点也不停

来源:百度知道 编辑:UC知道 时间:2024/04/28 05:30:59
单击Button会引发Rowcommand,我在这设置断点也不停,有谁遇到这情况,怎么解决啊,我比较笨,请尽可能详细解答

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "btn") //这个名设一下.
{
//TODO
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[index];

Label11111.Text = "您选择的是:<b>" + row.Cells[0].Text.Trim() + "</b>" + "--" + "<b>" +
row.Cells[1].Text.Trim() + "</b>" + "的内容是:";
SqlDataSource2.SelectParameters[0].DefaultValue = TextBox1.Text.Trim();
SqlDataSource2.SelectParameters[1].DefaultValue = TextBox2.Text.Trim();
SqlDataSource2.SelectParameters[2].DefaultValue = row.Cells[1].Text.Trim();
SqlDataSource2.SelectParameters[3].DefaultValue = row.Cells[0].Text.Trim();
SqlDataSource2.DataBind();
}
}

你是在botton的click事件加的断点吗?
你说的也太不明白了,补充一下你的情况,好给你解答。

你这个Button想实现什么功能啊?你是不是没有响应事件啊,或者在事件click代码里没有添加相应的代码!

Button按钮设置事