在页上绑定数据:
<asp:GridView ID="gvwProductInfo" runat="server" Height="1px" Width="586px" 
ShowHeader="False" Font-Size="10pt" AutoGenerateColumns="False" style="z-index: 100; left: 1px; position: relative; top: 1px" OnRowDataBound="gvwProductInfo_RowDataBound">
        <Columns>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:HyperLink ID="lnkProductName" runat="server" 
                    Style="z-index: 103; left: 89px;
                    position: relative; top: -83px" Width="200px" 
                    Text='<%# Bind("Name") %>' 
                    NavigateUrl='Items.aspx?ProductID=<%# Eval("ProductID") %>' 
                    Font-Bold="True" Font-Size="11pt"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
</asp:GridView>在点击HyperLink时地址栏中是:
    http://localhost:1064/PetShopOnline/Items.aspx?ProductID=<%#%20Eval("ProductID")%20%>
我想要的结果是:
    http://localhost:1064/PetShopOnline/Items.aspx?ProductID=P0001 这个样子!
请问怎么修改?
在线急等,谢谢!

解决方案 »

  1.   

    别用HyperLink,用<a href='Items.aspx?ProductID= <%#   Eval( "ProductID ")   %>'> <%#   Bind( "Name ")   %></a>
      

  2.   

    一般传值就是用
    <a href ="绑定字段来做的">
    这个题目就是这样子做<a   href= 'Items.aspx?ProductID=<%# Eval("ProductID") %>'><%# Bind("Name")%> </a> 
    我做的论坛就是这样子做的
    以后这一招会经常用的
      

  3.   

    你也可以在GridView的列属性中进行设计.NavigateUrl的值:items.aspx?ProductId={0},上面好象有一个NavigateUrlFeild的属性,设置为你想要的字段就可以了.
      

  4.   

    <asp:hyperlink NavigateUrl=  '<%# "Items.aspx?ProductID=" +Eval( "ProductID ")   %> '   
    />