onclick", "是要在点击后的
js没错

解决方案 »

  1.   

    CheckBox chk;
            if (e.CommandName == "del")
            {
                foreach (GridViewRow dvr in GridView1.Rows)
                {
                    chk = (CheckBox)dvr.FindControl("CheckBox1");
                    if (chk.Checked)
                    {
                        string id = e.CommandArgument.ToString();//前台把主键值绑定在按钮上
                        string id1 = dvr.Cells[1].Text;//通过页面上的绑定列取得主键
                        //通过GridView的DataKeys集合取得主键
                        string id2 = GridView1.DataKeys[(int)dvr.RowIndex].Value.ToString();
                    }
                }
            }是做的是删除的例子 多种得到主键值方法
    你得到主键值 放到SESSION中 同时再写个Response.Redirect("url");不就行了?
      

  2.   

    确实就是不跳转也不提示页面错误..
    连个javascript错误也不提示呢..
    高手都来看看啊..
    到底是哪出问题了...
     要的效果就是点击按钮跳转页面(不要新开一个页面).传值的问题不需要考虑..
    我只要跳转,,1~!~!~!~!
      

  3.   

    if (e.CommandName == "模板列中跳转按钮的cmdName")
    {
      Response.Redirect("mubiao.aspx");
    }
    这个是你要的不传值的
      

  4.   

    protected void BlackboardGV_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "delete")
                {
                    Myblackboard.HealthEducate_blackboard_Delete(Convert.ToInt32(e.CommandArgument));
                    Response.Redirect("BlackboardList.aspx");
                }
                else if (e.CommandName == "edit")
                {
                    Response.Redirect("BlackboardEdit.aspx?Blackboard_ID=" + Convert.ToInt32(e.CommandArgument));
                }
            }
            catch
            {
            }
        }
      

  5.   

    上面代码写在模板列事件里建个模板列 放个按钮  把事件写在模板列里你03时使的是DataGird 现在你用的GridView 当然不一样以前datagrid 有Item属性很方便
    现在的GridView都要先实力化行才能用两个控件不一样的地方多了