DataGrid1_ItemCreated里增加WINDOW.OPEN事件的一个操作方法.
我现在要做的是,我弹出的那个页面有一个参数传值.
e.Item.Attributes.Add("ondblclick","JavaScript:window.open('Log_news.aspx?Unid="+XXXXXX+"','LogViewMod','top=50,left=100,height=580,width=880,scrollbars=yes,toolbar=no,menubar=no,resizable=no,location=no,status=no');");这个XXXXXX的UNID如何来获取呀.我在DATAGRID里面已经创建好了DATAGRID里面的字段对应.

解决方案 »

  1.   

    查看网页的location对象,然后自己分析那个URL
      

  2.   

    Log_news.aspx?Unid=e.Item.Cells[0].Text
    ----------------------------------------
    但是问题出在e.Item.Cells[0].Text 没有值呀.怎么样才能获取得到呢.
      

  3.   

    在 DataGrid1_ItemDataBound 事件里面做吧:if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {
    string xxxx = (string)((DataRowView)e.Item.DataItem)["UNID"];
    e.Item.Attributes.Add("ondblclick","JavaScript:window.open('Log_news.aspx?Unid="+xxxx+"','LogViewMod','top=50,left=100,height=580,width=880,scrollbars=yes,toolbar=no,menubar=no,resizable=no,location=no,status=no');");
    }
      

  4.   

    我试过了,在datagrid当中的itemdatabound事件当中做不了这个事情.
      

  5.   

    我网页当中有两个DATAGRID..在代码页面当中搞错了.不好意思.