首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

大家,GridView里面编辑项,如何传到另外个页面进行修改

2013-05-02 
求助大家,GridView里面编辑项,怎么传到另外个页面进行修改求助大家,GridView里面编辑项,怎么传到另外个页

求助大家,GridView里面编辑项,怎么传到另外个页面进行修改
求助大家,GridView里面编辑项,怎么传到另外个页面进行修改,就是想得到当前项索引,跳转到另外个页面进行编辑,但是接收不到该值,不知道哪里出错了
编辑是个图片按钮
            ImageButton edit = e.Row.FindControl("edit") as ImageButton;
            edit.Attributes.Add("onclick", "edit_url(" + e.Row.Cells[0].Text + ");");这句不管用

接收编辑页面为
edit_SyUser.aspx



  string cindex = Request.QueryString["CIndex"].ToString();
            this.useId.Text = cindex;
            SqlParameter[] pars ={User1.ParamBuilder("@CIndex", Convert.ToInt32(cindex), SqlDbType.Char)};
            DataSet ds=User1.renturnDb("single_user",pars);

            this.txt_name.Text = ds.Tables[0].Rows[0][1].ToString();
            this.txt_userPwd.Text = ds.Tables[0].Rows[0][2].ToString();
            this.ddl_department.SelectedValue = ds.Tables[0].Rows[0][3].ToString();
            this.ddl_role.SelectedValue = ds.Tables[0].Rows[0][4].ToString();
            this.txt_addTime.Text=ds.Tables[0].Rows[0][5].ToString(); GridView
[解决办法]

引用:
引用:有得了怎么复杂吗?
<a href="你的修改页.aspx?id=<%# Eval("id")%>">修改</a>
正解... 一个修改而已  弄那么写脚本没必要的
是这样的,在gridview里面使用eval的话,添加一个模板列
  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"  OnRowDataBound="GridView1_RowDataBound" >
                <Columns>
                    <asp:BoundField HeaderText="ID" DataField="ID" />
   

                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>

<a href="你的修改页.aspx?id=<%# Eval("id")%>">修改</a>
                        </ItemTemplate>
                    </asp:TemplateField>

                </Columns>

热点排行