簡體   English   中英

記錄單擊的“網格視圖”列

[英]Recording clicked Grid View column

我在一個ASP頁面中有一個網格視圖,該頁面具有一個超鏈接字段,例如,CustomerID,可將用戶導航到各個網頁。 網格視圖中CustomerID的值可以有重復的值。 那么,我想要的是如何在CustomerID或超鏈接中記錄所有單擊的值? 請提出解決方案,以便該解決方案適用於gridview中的多個超鏈接列,每個導航到不同的網頁。

您可以組合使用gridview綁定列,並將它們作為url中的參數傳遞,並在其他頁面中作為Request.QueryString []集合進行檢索。

例如

 <asp:TemplateField>
            <ItemTemplate>
                <asp:HyperLink runat="server" NavigateUrl='<%# string.Format("~/Details.aspx?CustomerID={0}&Name={1}&Country={2}",
                    HttpUtility.UrlEncode(Eval("CustomerID").ToString()), HttpUtility.UrlEncode(Eval("Name").ToString()), HttpUtility.UrlEncode(Eval("Country").ToString())) %>'
                    Text="View Details" />
            </ItemTemplate>
  </asp:TemplateField>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM