这是来自ASPX页面(缩写)的网格视图:
<asp:gridview ID="Gridview1" runat="server" AutoGenerateColumns="false" OnRowCommand="GridView_RowCommand" DataKeyNames="order_no" onrowdatabound="Gridview1_RowDataBound" AllowPaging="false" >
<Columns>
<asp:HyperLinkField DataTextField="order_no" HeaderText="Order Number" ItemStyle-Font-Bold="true" /><asp:HyperLinkField />
<asp:BoundField DataField="id_number" HeaderText="Customer ID" ItemStyle-Font-Bold="true" />
</Columns>
</asp:gridview>
ASPX页面有一个带有“输入客户ID”标签的文本框和一个按钮。当用户输入文本并单击按钮时,我希望在后面的代码中找到Order_no的值。
答案 0 :(得分:0)
您可能正在寻找类似的东西
<asp:gridview ID="Gridview1" runat="server" AutoGenerateColumns="false" OnRowCommand="GridView_RowCommand" DataKeyNames="order_no" onrowdatabound="Gridview1_RowDataBound" AllowPaging="false" >
<Columns>
<asp:TemplateField >
<ItemTemplate>
<%# (Eval("order_no") > 0 ? "<a href="AnotherPage.aspx?OrderNo=Eval("order_no")">Something</a>" : "") %>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="id_number" HeaderText="Customer ID" ItemStyle-Font-Bold="true" />
</Columns>
</asp:gridview>