void ItemsGrid_Command(Object sender, DataGridCommandEventArgs e)
      {         switch(((LinkButton)e.CommandSource).CommandName)
         {            case "Delete":
               DeleteItem(e);
               break;            // Add other cases here, if there are multiple ButtonColumns in 
            // the DataGrid control.            default:
               // Do nothing.
               break;         }ms-help://MS.NETFrameworkSDKv1.1.CHS/cpref/html/frlrfsystemwebuiwebcontrolsdatagridclassitemcommandtopic.htm

解决方案 »

  1.   

    linkB.DataNavigateUrlFormatString="WebForm2.aspx?flag=" + DataGrid1.item.Cells[3].Text.ToString();
    这里item.Cells[3].Text就是你要选的那一行的标记内容
      

  2.   

    如何在打开WebForm2.aspx页面时,读取这个参数。多谢!
      

  3.   

    如果改为linkB.DataNavigateUrlFormatString="WebForm2.aspx?flag=" + DataGrid1.item.Cells[3].Text.ToString();提示DataGrid1中没有定义DataGrid1.item,请问为什么?
      

  4.   

    foreach(DataGridItem item in DataGrid1.Items)
    {
    string sRedirect="<a href='WebForm2.aspx?flag=" + item.Cells[1].Text.ToString()+ "'>" + item.Cells[4].Text + "</a>";
    item.Cells[4].Text=sRedirect;
    //上面是我的方法,你也可以用你的方法建立超级链接列
    }
    //在WebForm2用
    string flag=Page.Request.QueryString["flag"].ToString();