我想请教一个问题,我在VS2005里面 做了一个GrdidView 的,而且前面两列已经做成了链接的(编辑的列),而且可以跳转到其他的页面,但是我想问我怎么让他能够传递我点击的单元格的内容到下一个页面呢?下一个页面也用了一个DetailsView的控件,就是想通过传递的值来进行查询,谢谢!

解决方案 »

  1.   

    第一个页的链接
    NavigateUrl='<%# "nextpage.aspx?id=" + Eval("ItemID") %>'第二个页接收ID
    String youid=Request.QueryString["id"];
    设DetailsView的SelectCommand="Select * from table where id=" + youid;
      

  2.   

    <asp:HyperLinkField DataTextField="xxbt" HeaderText="标题" NavigateUrl="~/xxview.aspx?id=fs">
                            <ItemStyle Font-Size="14px" Height="15px" />
                            <HeaderStyle Font-Bold="True" Font-Size="15px" ForeColor="Blue" Height="16px" />
                        </asp:HyperLinkField>
                        <asp:HyperLinkField DataTextField="xxfs" HeaderText="发送者" NavigateUrl="~/fszhe.aspx?id=fs">
                            <ItemStyle Font-Size="14px" Height="15px" />
                            <HeaderStyle Font-Bold="True" Font-Size="15px" ForeColor="Blue" Height="16px" />
                        </asp:HyperLinkField>
    还是没有实现,大家帮帮吧,谢谢
      

  3.   


    <asp:HyperLinkField DataNavigateUrlFields="主键ID" 
       DataNavigateUrlFormatString="~/xxview.aspx?主键ID={0}"
         Text="修改" />把“主键ID”改成你表中的主键,
    然后在要传递到的页面中用
    string id = Request.QueryString["主键ID"].ToString();
    得到传过去的ID值