gridview一个模板列里放的hyperlink,怎么在点击它之后在弹出对话框的同时将行号传出

gridview一个模板列里放的hyperlink,如何在点击它之后在弹出对话框的同时将行号传出?
用模板列中放hyperlink的方法是因为这样在网页显示的字下没有下划线(这是前提),但是发现用attributes.add("onclick",...)的方法可以实现弹出对话框但是没法传出行号,望指点迷津!

if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowIndex != -1)
            {
                ((HyperLink)e.Row.FindControl("HyperLinkEdit")).Attributes.Add("onclick", "window.showModalDialog('assignexercise.aspx?id=" + this.GridView1.DataKeys[e.Row.RowIndex].Value.ToString() + "','','width=610px,height=635px,top=40px,left=150px');");
            }
------解决方案--------------------
 GridView1.DataKeyNames = new string[] { "id" }; 
        GridView1.DataBind(); 
------解决方案--------------------
建议换成LinkButton  里面加上CommandArgument='<%# Eval("id") %>' 

然后
"window.showModalDialog('assignexercise.aspx?id=" + e.CommandArgument
------解决方案--------------------
引用:
建议换成LinkButton  里面加上CommandArgument='<%# Eval("id") %>' 

然后
"window.showModalDialog('assignexercise.aspx?id=" + e.CommandArgument

gridview一个模板列里放的hyperlink,怎么在点击它之后在弹出对话框的同时将行号传出
------解决方案--------------------
引用:
引用:建议换成LinkButton  里面加上CommandArgument='<%# Eval("id") %>' 
"window.showModalDialog('assignexercise.aspx?id=" + e.CommandArgumentwindow.showModalDialog这句写在哪?

 ((LinkButton)e.Row.FindControl("LinkButton1")).Attributes.Add("onclick", "window.showModalDialog('assignexercise.aspx?id=" + e.CommandArgument.ToString() + "','','width=610px,height=635px,top=40px,left=150px');");