我用webform開發了一個頁面,可以參考下圖,現在遇到一個問題就是,當我滑鼠放到編號1.2.3.4對應的開始按鈕上時左下角頁面就會出現url的地址,如果我不想這個地址出現,隱藏掉我要怎么處理呀? 這4個開始按鈕的地址是gridview系結的資料庫欄位哩存放的地址。
請高手幫我實作下,先拜托啦

uj5u.com熱心網友回復:



等待好人出現
uj5u.com熱心網友回復:
貼出一段gridview的代碼<asp:GridView ID="GridView1" runat="server" Width="100%" CellPadding="2" ForeColor="#333333"
AutoGenerateColumns="False" AllowPaging="True" PageSize="12" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowDataBound="GridView1_RowDataBound" GridLines="None" EnableModelValidation="True" AllowSorting="True" CellSpacing="1" HorizontalAlign="Right" OnRowEditing="GridView1_RowEditing" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField HeaderText="編號" DataField="d_Number" ReadOnly="True" SortExpression="d_Number" >
<ControlStyle Width="400px" />
<FooterStyle HorizontalAlign="Center" Width="400px" />
<HeaderStyle HorizontalAlign="Center" Width="400px" />
<ItemStyle HorizontalAlign="Center" Width="400px" />
</asp:BoundField>
<asp:HyperLinkField AccessibleHeaderText="操作" HeaderText="操作" SortExpression="d_Item" Target="" DataNavigateUrlFields="d_Item" DataTextField="d_Item" DataTextFormatString="開始" >
<FooterStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:HyperLinkField>
</Columns>
<PagerSettings FirstPageText="" LastPageText="" NextPageText="" PreviousPageText="" />
<RowStyle Height="20px" BackColor="#F7F6F3" ForeColor="#333333" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
uj5u.com熱心網友回復:
有人嗎,能幫忙看看下uj5u.com熱心網友回復:
這個是瀏覽器顯示的,HyperLinkField會自動生成<a></a>標簽,你可以換成button按鈕控制元件,按鈕事件里再跳轉uj5u.com熱心網友回復:
是在girdview里加button按鈕控制元件是吧?
uj5u.com熱心網友回復:
這個是瀏覽器機制,沒辦法.只要你的href有東西.那么狀態欄一定會顯示這個URL地址.
當然肯定會有解決方案來替換.
第一:隱藏瀏覽器的狀態欄.
哈哈開個玩笑...
第二 生成的url沒有href(href="https://bbs.csdn.net/topics/#") 使用js來實作跳轉.
<a href="https://bbs.csdn.net/topics/#" url="xxxx.aspx">
$("a[url]").click(function(){
location.href=https://bbs.csdn.net/topics/$(this).attr("url");
});
這種辦法是使用a標簽的辦法..
至于你如何生成 我這里就不做討論了.
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/122629.html
標籤:ASP.NET
上一篇:System.Runtime.InteropServices.COMException:“型別不匹配,錯誤代碼:80020005
下一篇:求助這個邏輯該怎么寫
